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

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

Recommended Posts

Posted

Hello everyone. I'm trying to write a simple Find script that asks for two dates (start and finish), then automatically finds all records within that date range. I'm not sure what I'm doing wrong, but this seems like it should be simple???

I'm using the Custom Dialogue script step in FMP6 and having the dates stored temporarily in two global fields (date_from and date_to). I then attempted to have FM create a Find Request and insert:

date_from & "..." & date_to

...into my date field for the search. While FM doesn't complain about this script step, when run, it only inserts the first date. What am I doing wrong?

Thanks!

-Rob

Posted

Use DateToText( date_from ) & "..." & DateToText( date_to ) and be sure to use the Insert Calculated Result script step.

Posted

Just to guild the lilly a bit... i did this same feature yesterday, and you can trap for open-ended ranges too. this is the calculations used by the "Insert Calculated Result" step:

--

Case(

IsEmpty(gDateRangeStart) and IsEmpty(gDateRangeEnd),

TextToDate(""),

IsEmpty(gDateRangeStart),

"<=" & DateToText(gDateRangeEnd),

IsEmpty(gDateRangeEnd),

">=" & DateToText(gDateRangeStart),

DateToText(gDateRangeStart) & "..." & DateToText(gDateRangeEnd)

)

--

Posted

Hi Rob ...

Just to clarify Queue's reply:

1. You have to use the "Insert Calculated Result" script step. You can't use "Set Field".

2. The target date field must be on the current layout for the "Insert Calculated Result" script step to work.

Insert Calculated Result [your date field, TextToDate(gstartdate) & ".." & TextToDate(genddate)]

Posted

And to clarify Jim's reply: wink.gif

TextToDate is transposed. DateToText was the intent.

This topic is 7686 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.