H2 SQL Date Comparison
Asked Answered
D

2

8

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'
Diphenylamine answered 24/7, 2012 at 15:37 Comment(0)
R
1

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.

Retentive answered 15/12, 2020 at 22:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.