E.g.
db2 "select current date - (current date - 5 days) from SYSIBM.SYSDUMMY1"
1
----------
5.
1 record(s) selected.
OR
db2 "select ( DATE('2002-08-29') - DATE('2002-08-27') ) from
SYSIBM.SUSDUMMY1"
1
----------
2.
1 record(s) selected.
Abhijit Sinha
-----Original Message-----
From: Huber, Robert [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 11:23 AM
To: '[EMAIL PROTECTED]'
Subject: [DB2EUG] DB2 Date Difference Function?
Greeting,
I am quite new to db2 and need to form a join wherein I need to test for the
number of days difference between two dates. Coming from a Sybase background
the "and" clause would look something like " and datediff( day, date1, date2
) > 45", where datediff is a Sybase built-in function.
A search of the web has not given up any answer and I have no db2 manuals to
review.
Any pointers on how to deal with this greatly appreciated!
Thanks...
-
::: When replying to the list, please use 'Reply-All' and make sure
::: a copy goes to the list ([EMAIL PROTECTED]).
*** To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
*** For more information, check http://www.db2eug.uni.cc
-
::: When replying to the list, please use 'Reply-All' and make sure
::: a copy goes to the list ([EMAIL PROTECTED]).
*** To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
*** For more information, check http://www.db2eug.uni.cc