Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7733 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all,

I'm a fm 6 newbie. I have a database with a date and boolean checkbox (the field is specified as a number). I can get filemaker to search on the date ok, but i want to search on boxes that are NOT checked. Basically, the search needs to be for a specific date AND the box is UNchecked. I've tried Null values... The script I'm using looks like this for the date:

Enter Find Mode []

Insert Current Date [select, "MyDateField"]

Perform Find [replace found set]

Now, how do I find the empty checkbox? Should I be using a different search technique in the first place?

Thanks a billion!

-Will

Posted

Hi Will,

Yes it is a small world.

Maybe I missunderstood the problem.

Explain your find beyond the MyDateField part.

Lee

Posted

The MyDateField is for the date, not the checkbox. We'll call the checkbox "CheckboxField"

So I changed "CheckboxField" to a Text field, and when i enter find mode and put in the equal sign (=) it returns the proper files, but for some reason, it won't work with either insert text[select,"CheckboxField","="] or insert calculatedresult[select, "checkboxfield",""=""]. Thoughts?

Posted

Hi:

I'm in san diego. Not-so-small state. Did you guys watch the governor debates last night? smile.gif

If I understand you correctly, you want to find for a certain date, AND if a field is emtpy. So go like this:

Allow user abort [off]

Set error capture [on]

Enter Find Mode []

Set Field [Date field, "your date"] - enter the date you are searching for

Set Field [Checkbox field, "="]

Perform Find

Lee had the right operator, but I don't think you're trying to find for the date field being emtpy.

I guess I should add that if you are finding a static date, then Set Field will work, but if you are looking for a calculated date, you should use Insert Calculated Result. And make sure the date field you are searching on is on the current layout when the find is executed.

Ken

Posted

If your checkbox field is a true boolean, then it should never be empty. You should auto-enter a zero in it and then search for that.

With the way you currently have it set up, you can use Set Field["checkbox", ""=""] and find on that. You also don't need an Insert for the date field if you're searching for a single date. A Set Field will suffice.

Posted

When I use ANY of the Insert or Set functions with either = or "=" I get a result back saying that "No valid criteria in this request..." My Exact Script looks like this:

Enter Find Mode []

Set Field ["CheckboxField", ""=""]

Perform Find [Restore, Replace Found Set]

I also tried:

Enter Find Mode []

Insert Text ["CheckboxField", "="]

Perform Find [Restore, Replace Found Set]

The latter returns every record, checked or not.

The checkbox field is a text type, and entering the = works in the regular find mode... Is there a special way of representing

Posted

Ken, do you mean a calculated date or a date range? Set Field works for any date, as long as it's a single result.

Posted

Why are you using the 'Restore' option and what criteria is restored? Print a hard copy of the script and see what is being restored. That is overwriting your find criteria.

Posted

I guess I worded it wrong.

If it's a calculated result, use Insert Calculated Result. (talk about stating the obvious, huh?) smile.gif

For example, assume you have two date fields, date1 and date2. If I wanted to find in date2 for: date1 >= Status(CurrentDate) - 7, Set Field will not work. You have to use Insert Calculated Result. But if your date is static, either by entry of by another field's value, then Set field will work.

Hope that made sense.

Ken

Posted

Ah, that's what I thought. You mean single date and date range. ">= Status(CurrentDate) - 7" is a range, not a single date, and therefore requires the use of Insert Calculated Result; whereas Date( Month( Status(CurrentDate) ), 5, Year( Status(CurrentDate) ) ) is a calculated result but can use Set Field as it is a single date that results (yet it's not static) wink.gif

I was just a bit confused over your definitions for the words. Thank you for helping me clarify.

Posted

Hi Will,

I had to leave for a little bit, and I just got back to find that you have resolved your problem.

It's nice to know that there are others in my area working with FileMaker too.

Best regards,

Lee

This topic is 7733 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.