people,
I need to get the diffrence between 2 date fields in Months..I can use the Xfm..but cannot use any user defined Qry..or touch any DB table...
If the difference in Months is > 60..i need to set a Flag else Unset it..
The functionality shld be similar to something like
If
TIMESTAMPDIFF(64, CHAR(TIMESTAMP_ISO(CURRENT TIMESTAMP) - TIMESTAMP_ISO(a.Date_Field))) > 60 then 'Y' else 'N'
In DB2..
any ideas...
thanks.
Date Difference in Months
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 38
- Joined: Wed Mar 17, 2004 1:16 am
- Location: USA
Date Difference in Months
..i did not invent many things..but i can make them Better..
-
- Participant
- Posts: 24
- Joined: Fri Oct 01, 2004 1:43 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This one may be easier to do - assuming that the 60 is fixed - to get the difference in years. 60 months is always 5 years, irrespective of leap years and other confounding factors.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.