I am attempting to write a rule that checks a date, stored as a epoch unix timestamp integer, and have it fail the rule if that date is greater than current date. the code is as followed:
DECLARE
$EST_DATE datetime;
BEGIN
$EST_DATE = SQL(‘dataconnection’, 'SELECT DATEADD(s,epcoch_date_field, ‘1970-01-01 00:00:00’) From table) ;
If ($EST_DATE < sysdate())
RETURN TRUE;
ELSE
RETURN FALSE;
END
I get the error for the SQL script line of
Syntax Error at . (COR 10611)
Any ideas on how to accoplish this or resolve error?
Update on Issue: I have corrected the original sytax error: I neglected to preceed the embedded qoutes with the , I have done that now I get a new error that currently does not make sense to me.
I now get the error on the SQL line 4: Datatype incompatibilty: found type But expecting . (COR-10600)
The DATEADD SQL Function returns a datetime, not a varchar, so I am unclear as to why I would get this error.
Any thoughts, insights or assistance would be greatly appreciated!