Previous Month Last Date
Moderators: chulett, rschirm, roy
Previous Month Last Date
Hi,
How to get the last date of the previous month.?
Thanks
Ashish
How to get the last date of the previous month.?
Thanks
Ashish
-
- Charter Member
- Posts: 199
- Joined: Tue Jan 18, 2005 2:50 am
- Location: India
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Make it then.
Code: Select all
trunc(sysdate, 'mm') - 1
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
in datastage this should work fine.talk2shaanc wrote:DateFromDaysSince(-1, stringtodate(right(0:MonthFromDate(CurrentDate()),2):'-':'01':'-': YearFromDate(CurrentDate()),"%mm-%dd-%yyyy"))
this first derives the 1st day of current month and then subtracts 1 day from that.
in oracle sainaths code works fine.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)
priyadarshikunal wrote:in datastage this should work fine.talk2shaanc wrote:DateFromDaysSince(-1, stringtodate(right(0:MonthFromDate(CurrentDate()),2):'-':'01':'-': YearFromDate(CurrentDate()),"%mm-%dd-%yyyy"))
this first derives the 1st day of current month and then subtracts 1 day from that.
in oracle sainaths code works fine.
Hi guys,
Thanks for the information
Thanks Ashish