November 11, 200322 yr 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
November 11, 200322 yr Use DateToText( date_from ) & "..." & DateToText( date_to ) and be sure to use the Insert Calculated Result script step.
November 11, 200322 yr 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) ) --
November 11, 200322 yr 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)]
November 11, 200322 yr And to clarify Jim's reply: TextToDate is transposed. DateToText was the intent.
Create an account or sign in to comment