Do the following... In the set fields filter action before yours (Add a set fields action before yours ;) set a DisplayOnly integer field to $TIMESTAMP$ and use that integer field in your SQL. The database will not automatically convert a date string into the Epoch number that the date is stored in the datbase as. Fred
________________________________ From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Payne, George Sent: Wednesday, July 23, 2008 2:10 PM To: arslist@ARSLIST.ORG Subject: Limiting SQL select statements by AGE ARS 7.0.01 P05 DB Oracle 10g I'm looking to make a "Set Fields" Filter Action to Count the number of records in an ARS Table where the value of the field is '1' and the record is more than 1 week old. This SQL works fine (returns a value for $1$ of =392): SELECT Count(C18099) FROM T1116 WHERE C18099=1 But it fails when I try to add the criteria for the age of the record (throws an error: ARERR [552] Failure during SQL operation to the database : ORA-00904: "07/23/08 14:06:46"-604800: invalid identifier): SELECT Count(C18099) FROM T1116 WHERE C18099=1 AND C3<"$TIMESTAMP$"-604800 I've used the "$TIMESTAMP$"-604800 worked from an Advanced Search on the User Tool...I'm sure it's just something to do with either my SQL syntax or the way the "Create Date" (C3) is stored on the database. I know it's out there as number of seconds since 1/1/70, but the error seems to indicate that the "$TIMESTAMP$" is being interpreted as "07/23/08 14:06:46". Maybe I need to use a FUNCTION for Timestamp that Oracle understands?? Thanks in advance, George George Payne Corporate Applications Developer Electric Reliability Council of Texas (512) 248-3940 [EMAIL PROTECTED] _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"