Date Difference

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mspanda
Participant
Posts: 32
Joined: Tue May 09, 2006 6:22 am
Location: bangalore

Date Difference

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Please DO NOT double post. You have an answer in your other thread with this problem.

Moderator - please delete this duplicate thread.
mdtauseefhussain
Participant
Posts: 38
Joined: Mon Feb 27, 2006 10:34 pm
Location: Chennai
Contact:

Hi!

Post 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
Mohammed Tausif Hussain Sheikh
Cognizant technologies,Perungudi
Chennai
Post Reply