Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Interval usage?
Thu, Apr 30 2020 1:56 AMPermanent Link

Ian Branch

Avatar

Hi Team,
I don't seem to be reading the Help correctly. Frown
I have the following as part of a where in a sql query..
{sql}
...
and (JobStatus = 'CL') and ((Current_TimeStamp - DateClosed) > Interval '5' DAY)
...
{sql}
DateClosed is a TimeStamp field in the table.
I am wanting the condition to be true when the the DateClosed is more than 5 days ago.
What have I missed please?

Regards & TIA,
Ian
Thu, Apr 30 2020 1:58 AMPermanent Link

Ian Branch

Avatar

Missed some info.
I get the following error when the query is executed in EDBMgr.
"ElevateDB Error #700 An error was found in the statement at line 3 and column 64 (Expected Interval Day To MSecond expression but instead found INTERVAL '5' DAY)"
Thu, Apr 30 2020 3:31 AMPermanent Link

Ian Branch

Avatar

All sorted.

{sql}
and (Current_Date - Cast(DateClosed as Date)) > interval '5' day
{sql}

Thanks for looking.
Ian
Image