Hi Guys
Could you please tell me how can i get date different in Datastage(server) without using the user defined Routine/function.
Example: 07/02/2006 and 03/01/2005 (any format )
output: 04/01/0001
(i need in Data stage)
i got one function here like:
DateGenericDateDiff(1st date, 2nd Date) in dx7.5
but i am not getting my requirment .
please do the needful.
Thanks
-Mspanda
Date Difference
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 38
- Joined: Mon Feb 27, 2006 10:34 pm
- Location: Chennai
- Contact:
Hi!
If you want to do this in query level you can use this
SELECT to_char(TO_CHAR(DATETIME_ADDED,'YYYY')-TO_CHAR(UDT_DATE,'YYYY'))||'/'||
to_char(TO_CHAR(DATETIME_ADDED,'MM')-TO_CHAR(UDT_DATE,'MM'))
||'/'||to_char(TO_CHAR(DATETIME_ADDED,'DD')-TO_CHAR(UDT_DATE,'DD')) AS DATEDIFF FROM EDW_PRODUCT_D
SELECT to_char(TO_CHAR(DATETIME_ADDED,'YYYY')-TO_CHAR(UDT_DATE,'YYYY'))||'/'||
to_char(TO_CHAR(DATETIME_ADDED,'MM')-TO_CHAR(UDT_DATE,'MM'))
||'/'||to_char(TO_CHAR(DATETIME_ADDED,'DD')-TO_CHAR(UDT_DATE,'DD')) AS DATEDIFF FROM EDW_PRODUCT_D
Mohammed Tausif Hussain Sheikh
Cognizant technologies,Perungudi
Chennai
Cognizant technologies,Perungudi
Chennai