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

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

Recommended Posts

Posted

I'm trying to use a script found in another post:

Enter Find Mode[]

Set Field[MyTable::MyDateField; (Get(CurrentDate) - 30)&"..."Get(Current Date)"]

Perform Find[]

However, I keep getting an error message that an operator is expected after the semicolon.

Am I missing something?

Posted

(Get(CurrentDate) - 30)&"..."Get(Current Date)

(Get(CurrentDate) - 30)&"..." [color:red]& Get(Current Date)

--sd

Posted

${Territory}:):language updated[color:red]; (Get(CurrentDate) - 30)&"..." & Get(Current Date)

I actually had the "&" in the script, simply left it out of my comment. However, my problem is after the [color:red]";".

Error message indicates I need an operator there.

Posted (edited)

need to use GetAsText:

${Territory}:):language updated; GetAsText((Get(CurrentDate) - 30)&"..." & Get(Current Date))

Edited by Guest
missed ( )
Posted

You don't tell the Set Field script step what field to set in the calculation. The calculation is the result only. The field is defined via a separate dialog (Specify target field) which is a drop down list of all fields.

You haven't really named your tables and fields with $ and () characters have you?

Posted

yes, it needs you to explicitly tell it the result to set into the field is TEXT although you are using the date range. the field that you are trying to set is a date field hence to insert a date range you need to use "GetAsText"

Posted

Only if the field isn't on the layout, a Go To Field can make it happen "amputated" the field where to put it. But if the semicolon is part of the calc', is it pretty obvious why the bleeping happens.

GetAsText( is not necessary doe to the ampersands already in there. Breezer you are right it used to be so before fm7!

--sd

Posted (edited)

Thanks Soren and D J for pointing that out, all along I have been assuming it's required.

Edited by Guest
Posted

Okay, now I'm getting it. However, the script is not responding the way I expected it to. I want it to find all records with a date (in specified field) 'older than' 30 days from current date.

Posted

The easiest way is to make it an omitted request, provided you have nothing after today, it's done by adding an Omit Record/Request step just before the Perform find.

--sd

Posted

I want it to find all records with a date (in specified field) 'older than' 30 days from current date.

Why not say so right at the start. Try:

Enter Find Mode [ ]

Set Field [ YourTable::Datefield ; "<" & Get ( CurrentDate ) - 30 ]

Perform Find [ ]

Posted

Okay, it's working.

For future reference, I was using the "Calculating result" option for everything, but once DJ noted I had to use the "Specified Target Field" also it all came together.

Thanks!!

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