|
View previous topic :: View next topic
|
| Author |
Message |
aimprabhu
New User
Joined: 12 Aug 2008 Posts: 11 Location: chennai
|
|
|
|
Hi Please give a sugestion.I have to run query which gives difference between two dates.
It is not diff between timestamp.
Eg:
Table A Table B
D1 D1
How can we find the difference between the total no.of days |
|
| Back to top |
|
 |
hikaps14
Active User

Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
Hi,
try using the query below:
SELECT TableA.D1 - TableB.D1
FROM TableA , TableB ;
Ex:
SELECT CURRENT_DATE - '2008-10-10'
FROM SYSIBM.SYSDUMMY1 ;
Thanks,
-Kapil. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
SELECT TableA.D1 - TableB.D1
FROM TableA , TableB ;
|
Did you test this?
Please post the result of your test. . . |
|
| Back to top |
|
 |
anandinmainframe
Active User

Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Hi,
This will give you the difference between the two dates.
SELECT DAYS('10/10/2008') - DAYS('10/05/2008')
FROM SYSIBM.SYSDUMMY1 |
|
| Back to top |
|
 |
|
|