Page 1 of 1

Date Difference

Posted: Thu May 11, 2006 4:21 am
by mspanda
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

Posted: Thu May 11, 2006 4:40 am
by ArndW
Please DO NOT double post. You have an answer in your other thread with this problem.

Moderator - please delete this duplicate thread.

Hi!

Posted: Thu May 11, 2006 11:50 pm
by mdtauseefhussain
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