Oracle Date logic

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
kumar444
Premium Member
Premium Member
Posts: 62
Joined: Wed Jan 12, 2011 10:01 am

Oracle Date logic

Post by kumar444 »

Can anybody please tell me how to implement this date logic in datastage?

Oracle :
trunc(last_day(add_months(sysdate,-1)))
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In order to get help from the largest pool of people, you really should restate the question in words - meaning, explain what the Oracle sql is doing. Or is that part of the issue?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar444
Premium Member
Premium Member
Posts: 62
Joined: Wed Jan 12, 2011 10:01 am

Post by kumar444 »

Thanks Craig I will keep this in mind while posting hereafter. Any suggestions on how to make this logic work in datastage.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Do you know what the sql logic does? If so, please describe it in the thread. Once the desired results are known, then a solution can quickly be found.

If you don't know what the sql does, please say so. Then someone can describe that and you will learn that much more!

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
kumar444
Premium Member
Premium Member
Posts: 62
Joined: Wed Jan 12, 2011 10:01 am

Post by kumar444 »

Sorry for not being precise.
This code will get the values or records of midnight of last day of last month.

For example:If sysdate is 12-Dec-2011 then the result is 30-Nov-2011 12:00am or 1-Dec-2011 00:00 am.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Well, the time part is easy, as that's a constant.

As to the date part, simply subtract one more than the day number from the date, using DateFromDaysSince() function.

Code: Select all

DateFromDaysSince(svTheDate, DayFromDate(svTheDate) + 1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar444
Premium Member
Premium Member
Posts: 62
Joined: Wed Jan 12, 2011 10:01 am

Post by kumar444 »

Thanks Ray but i could only see the first line of your content.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What you need to get is a premium membership - this will allow you to read the entirety of the premium posters' contributions, and will help to fund the continued existence of DSXchange. All premium membership fees are devoted to the hosting and bandwidth costs of DSXchange.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar444
Premium Member
Premium Member
Posts: 62
Joined: Wed Jan 12, 2011 10:01 am

Post by kumar444 »

Ray I would like to do that but need some time.
Post Reply