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

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

Recommended Posts

  • Newbies
Posted

I want to write a script which finds all records older than two weeks. I tried entering "< // - 14" into the Create Date field, but it won't accept that as a valid date. "// - 14" is okay, and so is "< //" but it doesn't like it when you put them together. I have tried several ways to get around this, and so far none work. I am using FM 4.1 for Windows NT. Any suggestions?

Posted

hi,

This may just be a simplistic response, but use brackets! Try it so that the comparison is date < ( // - 14 ). FMP seems to like brackets!

Posted

Use a calculation field "cResult" to perform the (Today-14) operation then paste in the result like this...

Enter Find Mode

Set field ["Date Field", " "<"& cResult" "]

Perform Find [ ]

Hope this helps

G

  • Newbies
Posted

thanks sprague, I found out you can condense those lines into one:

set field ["Create Date", ""< " & (Today - 14)].

the key is using quotes and the & symbol. However, when the script pastes that calculation into the field, it deletes the "<"- finding only those records which are exactly 2 weeks old, not more than 2 weeks old. I don't know why it does this and so far I can't get it to stop. Using "Paste Result" retains the less than symbol, but converts the date into an unformatted string of numbers. Do you have any idea what is going on?

  • 2 weeks later...
Posted

You do need to use paste result for this. However, you'll need to add the DateToText function. That way, it will place all the info into the field, just as if you typed it in.

Paste Result["Create Date", ""< " & DateToText((Today - 14))].

The Same thing has to be done for date ranges.

Paste Result["Create Date", ""DateToText(Starting date) & "..." & DateToText(Ending Date)""

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