Here is the code in PostgreSQL I am trying to run:
select DATE_ADD(whenbooked,INTERVAL 4 HOUR) from booking WHERE id = 12310;
OR I try to run this code:
select DATE_ADD('2010-11-19 01:11:22',INTERVAL 4 HOUR)
Both codes access date/time stored in the same manner:
2010-11-19 01:11:22
PostgreSQL error code is this:
ERROR: syntax error at or near "4"
it is referring to the '4' in the line 'INTERVAL 4 HOUR'.
I can't figure out what the issue is.
I need to compare a time/stamp (written in exactly the same format as above) with the stored time/date PLUS 4 hours.
So the desired end result is to return: '2010-11-19 05:11:22'.
If this can be done in PHP or directly in SQL?
select DATE_ADD('2010-11-19 01:11:22',INTERVAL 4 HOUR)works for me ...select DATE_ADD('2010-11-19 01:11:22',INTERVAL 4 HOUR)works for me too