Previous date and time

moon-buddy

ADSM.ORG Moderator
Joined
Aug 24, 2005
Messages
7,010
Reaction score
406
Points
0
Location
Somewhere in the US
Does someone know the right syntax for this? Tried other variations.

Trying:

select node_name from events where status='Failed' and (scheduled_start>({'2018-06-02 08:00:00'}-1 day) and scheduled_start<('2018-06-02 08:00:00'))

to get failed backups between the two dates of 2108-06-01 and 2018-06-02.

Fails on the date structure: An expression with a datetime value or a labeled duration is not valid.
 
I think you can only do math with the date if you specify current_timestamp or a field name.

Try this instead:
select node_name from events where status='Failed' and (scheduled_start+1 day>(('2018-06-02 08:00:00')) and scheduled_start<('2018-06-02 08:00:00'))
 
Back
Top