One option is to use the DAYS function so you would have something like " and (DAYS(date1) - DAYS(date2)) > 45".
The DAYS function can be found at http://www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/document.d2w/report?fn=db2v7s0sqls0415.htm#HDRFNDAYS Version 7 manuals can be found at http://www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v7pubs.d2w/en_main (Beware of wrapping characters on the first URL) -----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
