Connecting Tech Pros Worldwide Forums | Help | Site Map

using timestamps in sql statements on DB2 tables

sat sat is offline
Newbie
 
Join Date: Aug 2006
Posts: 2
#1: Aug 4 '06
Hi ,
I am very new to DB2 and I am trying to extract some rows from a db2 table based on a field of timestamp datatype.

I am trying the following.
1) select * from test where add_tms ='08/03/2006 12:00:00 AM'
2) select * from test where add_tms>='07/02/2006 12:00:00 AM' and add_tms<='08/03/2006 12:00:00 AM'

both the sql statments dont work.

any help?
thanks in advance
sat

ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Aug 4 '06

re: using timestamps in sql statements on DB2 tables


Are you certain that the date/time was originally stored as '08/03/2006 12:00:00 AM' in the database and not as '08/03/2006 12:00:00'?

Ronald :cool:
sat sat is offline
Newbie
 
Join Date: Aug 2006
Posts: 2
#3: Aug 4 '06

re: using timestamps in sql statements on DB2 tables


Hi,
When I do a select * from the table,thats what it displays.
Thanks
Satish
Reply