How can i write a query in DB2 for following thing:
The difference between current timestamp and a timestamp field in dB should be >=4 hours AND <= 24 hours
Some one suggested this but its not working.
select * from tableName where
date <= DATEADD([hour], -4, CURRENT_TIME) and
date date >= DATEADD([hour], -24, CURRENT_TIME)
But its not working.Its giving following error.
SQL0104N An unexpected token "[hour]" was found following "ortdate <=
DATEADD(". Expected tokens may include: "<func_arg_list>". SQLSTATE=42601