try casting the timestamp first to a date so you are comparing apples to apples
SELECT * FROM SCHEDULER_HISTORY WHERE CAST(END_TIME AS DATE) = CURRENT_DATE(); On Wednesday, August 6, 2014 2:51:34 AM UTC-4, Phamorn Hongsawat wrote: > > In my table, there is date field (timestamp). Example value of data in > this field is *2014-08-06 09:00:00* > > How can I SELECT all data which day-month-year is today? > > I try to use query as below: > > SELECT * FROM SCHEDULER_HISTORY WHERE END_TIME = CURRENT_DATE(); > > It doesn't working. Then I using: > > CALL CURRENT_DATE(); > > and the result is > > CURRENT_DATE() > <#[email protected][email protected]_> > > 2014-08-06 > and try this query > > select end_time from scheduler_history where end_time like '2014-08-06%' > > and the result is > > END_TIME > <#[email protected][email protected]_> > 2014-08-06 > 09:00:00 > > Thank you for your help. > > Phamorn Hongsawat > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
