H2 SQL Date Comparison

Viewed 19043

In an H2 database on a column of type TIMESTAMP how do I run a query

SELECT * FROM RECORDS WHERE TRAN_DATE < '2012/07/24'
2 Answers

For me the following helped, because I also needed to compare the full timestamp with date and time:

SELECT * FROM RECORDS WHERE TRAN_DATE < TIMESTAMP '2020-07-24 20:00:00'

This may help others even if it doesn't help the questioner.

Related