The Headache Posted May 15, 2008 Posted May 15, 2008 Hi I'm not sure if this is a calculation situation, a script situation or both. I need to find a set of records that is in a date range of "14 days prior to today... to today" on a daily basis and automated with a button/script. In short - click a button and records with that date range would be found. THANKS.
comment Posted May 15, 2008 Posted May 15, 2008 See if this helps: http://www.fmforums.com/forum/showpost.php?post/214185/
ddreese Posted May 15, 2008 Posted May 15, 2008 Something along these lines: Enter Find Mode Set field [ Table::Date field; Get (CurrentDate) & ".." & Get (CurrentDate) - 14 ] Perform Find That may be simplifying it a bit, but it's the basics.
comment Posted May 15, 2008 Posted May 15, 2008 I'm afraid that won't work, but this will: Set field [ Table::Date field; Get (CurrentDate) - 14 & ".." & Get (CurrentDate) ]
The Headache Posted May 16, 2008 Author Posted May 16, 2008 Thanks. I kept getting the "Need operater here" message at semicolon. I had to change the semicolon to "&" and put a "(" and ")" at the both ends and it worked great This is what I did with my table and date field inserted: TABLE::DATE FIELD & (Get (CurrentDate) - 14 & ".." & Get (CurrentDate)) Thanks again!
comment Posted May 16, 2008 Posted May 16, 2008 (edited) The semicolon is a separator between the two options of the Set Field[] script step. First, you select the target field, i.e. which field you want to set (that would be TABLE::DATE FIELD). Next, you specify the calculated result - that would be ONLY THIS: Get (CurrentDate) - 14 & ".." & Get (CurrentDate) Note that you do NOT include the target field here, unless you want to keep the existing contents; for example, Set Field [ somefield ; somefield & "a" ] appends "a" to whatever is already in somefield. In your case, when you enter Find mode, the field is initially empty (no criteria specified), so the reference does not actually do anything, but it still shouldn't be there. I don't see how the extra parentheses help either. Edited May 16, 2008 by Guest
Recommended Posts
This topic is 6095 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