Late date of Month..

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Mhasan
Participant
Posts: 38
Joined: Wed Apr 19, 2006 10:03 pm
Location: Bangalore

Late date of Month..

Post by Mhasan »

Can anybody tell me How to Get the Last date of the month....
Ex : input 1 feb 1993
I need output As 28 feb 1993 How to achive this.
Thanks
M A hasan
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Try

Code: Select all

DateFromDaysSince( -1 ,StringToDate('1993/02/01','%yyyy/%mm/%dd')) 
Mhasan
Participant
Posts: 38
Joined: Wed Apr 19, 2006 10:03 pm
Location: Bangalore

Post by Mhasan »

Thanks For info ...
My requiremnt is i need last date of the month from the given input date ..not the previous date... -1 will only give me previous Date
Thanks
M A hasan
baglasumit21
Participant
Posts: 132
Joined: Wed Mar 01, 2006 11:12 pm
Location: Pune

Post by baglasumit21 »

Mhasan wrote:Thanks For info ...
My requiremnt is i need last date of the month from the given input date ..not the previous date... -1 will only give me previous Date

Try using
ConvertMonth((Oconv('1993/02/01'), 'D-YM')), "L")
SMB
Mhasan
Participant
Posts: 38
Joined: Wed Apr 19, 2006 10:03 pm
Location: Bangalore

Post by Mhasan »

Thanks
That will work out in Basic transformer
How to do the same in usiing Parallel Transformer.
Thanks
M A hasan
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Mhasan - I didn't give you the complete answer on purpose. The DateFromDaysSince() function using -1 will give you date one day prior to the input. So all you need to do is change your date to the first day of the next month (perhaps using string-based functions?) and then apply DateFromDaysSince(). If this is too much work, try using the forum's search functionality and you will discover that this is not the first time the question has been asked and answered.
Post Reply