Davidatlamont Posted January 29, 2008 Posted January 29, 2008 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?
Søren Dyhr Posted January 29, 2008 Posted January 29, 2008 (Get(CurrentDate) - 30)&"..."Get(Current Date) (Get(CurrentDate) - 30)&"..." [color:red]& Get(Current Date) --sd
Davidatlamont Posted January 29, 2008 Author Posted January 29, 2008 Thanks, however my problem is here: Enter Find Mode[] Set Field[MyTable::MyDateField[color:red]; (Get(CurrentDate) - 30)&"..."Get(Current Date)"] Perform Find[]
Søren Dyhr Posted January 29, 2008 Posted January 29, 2008 You're missing an [color:red]& in your calc... --sd
Davidatlamont Posted January 29, 2008 Author Posted January 29, 2008 ${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.
Breezer Posted January 29, 2008 Posted January 29, 2008 (edited) need to use GetAsText: ${Territory}:language updated; GetAsText((Get(CurrentDate) - 30)&"..." & Get(Current Date)) Edited January 29, 2008 by Guest missed ( )
Davidatlamont Posted January 29, 2008 Author Posted January 29, 2008 Thanks, but my problem is after the semicolon. Script message indicates it's looking for an operator between [color:red]";" and whatever follows.
David Jondreau Posted January 29, 2008 Posted January 29, 2008 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?
Breezer Posted January 29, 2008 Posted January 29, 2008 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"
Søren Dyhr Posted January 29, 2008 Posted January 29, 2008 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
David Jondreau Posted January 29, 2008 Posted January 29, 2008 the field that you are trying to set is a date field hence to insert a date range you need to use "GetAsText" I'm pretty sure that's not accurate.
Breezer Posted January 29, 2008 Posted January 29, 2008 (edited) Thanks Soren and D J for pointing that out, all along I have been assuming it's required. Edited January 29, 2008 by Guest
Davidatlamont Posted January 29, 2008 Author Posted January 29, 2008 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.
David Jondreau Posted January 29, 2008 Posted January 29, 2008 Today, Get(CurrentDate) - 30) & "..."& Get(Current Date) is 12/30/2007...1/29/2007 You'll have to change your calculation.
Søren Dyhr Posted January 29, 2008 Posted January 29, 2008 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
comment Posted January 29, 2008 Posted January 29, 2008 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 [ ]
Davidatlamont Posted January 29, 2008 Author Posted January 29, 2008 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!!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now