I have managed to reproduce this using FMPA 10.0v3 under OS X 10.5.8. The strange thing is that the same formula produces the correct result when used in Data Viewer.
This is a problem since we use this function to make complex date range find requests.
Regardless of the bug, I'd advise you to always use Date functions for date calculations, and reserve the GetasText() function for those cases where you actually need a text result.
I'm learned some tricks in FMP6 and keep using them - maybe there is a better way and will eliminate this bug...
To find a date range from a script I do the script step in find mode of: "insert calculated result -GetAsText(Invoices_::G Start Date)&"..."&GetAsText(Invoices_::G Stop Date)"into the date field I want to preform the find on. At least n FMP6 I had to convert the date to text otherwise it wouldn't work since I am putting a text string into a date field. I just kept doing it this way in newer version of FMP.
So what is suggested in FMP10 for finding a date range in a script step? Is there a more modern way?
You can use Set Field instead of Insert Calculated Result, and you can set the searched field to =
Invoices_::G Start Date & ".." & Invoices_::G Stop Date
Thank you for your posts.
This problem has been previously reported, and I have attached your post to the original case.
The calculation provided by "comment" (Thank you!) should give you the desired results.