Hi ,
I have a requirement to implement oracle logic in datastage.
Oracle funcion:-
(trunc(sysdate,'D') This yields last day of previous week.i.e. sunday
suppose if system date is 1/11/2011(tuesday) ,output of (trunc(sysdate,'D') is 1/09/2010(sunday).
Can someone help me how to implement this in datasatge.
Thanks,
date functions
Moderators: chulett, rschirm, roy
Re: date functions
Sorry, but no it does not. It simply returns the current day.SwathiCh wrote:Oracle funcion:-
(trunc(sysdate,'D') This yields last day of previous week.i.e. sunday
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 43
- Joined: Thu May 29, 2008 8:41 pm
Re: date functions
Following will give next Sunday. If you deduct 7 days, you will get previous Sunday.
Next_Day(to_date(date,'dd-mon-yy'), 'Sunday')
Thanks.
Next_Day(to_date(date,'dd-mon-yy'), 'Sunday')
Thanks.
Code: Select all
DateFromDaysSince(-WeekdayFromDate(CurrentDate()),CurrentDate())
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Code: Select all
DateFromDaysSince(-WeekdayFromDate(CurrentDate())+7,CurrentDate())
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.