Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Hours to Sysdate

Status
Not open for further replies.

Edie0802

Programmer
Jul 11, 2003
68
0
0
US
I am trying to create a new object (or two) in a universe. The user wants data pulled every day at 4 pm for the next 24 hours. I know which date field he wants me to use.

I pulled an object called Today into the report. It is based on sysdate and shows today's date and time at 12:00 am.

I also pulled an object called Tomorrow into the report. It is based on sysdate +1 and shows tomorrow's date and time at 12:00 am.

I need perhaps two new objects that start today at 4 pm and ends tomorrow at 4 pm. Or, perhaps another way to approach this problem.

I am a crystal person and not too experienced at webi.

Thanks.
 

Are you trying to create a filter object that will return records from 4:00 today through 4:00 tomorrow?

If not, please describe in greater detail what you need to do.
 
try to see if sysdate + .75 returns today at 4:00 pm (16:00). If it does, then you can just do sysdate+1.75 to get tomorrow at 4:00 pm.

Steve Krandel
Intuit
 
I finally figured it out.

I used this for today at 4 pm: trunc(sysdate) + 16/24

I used this for tomorrow at 4 pm: trunc(sysdate) + 1 + 16/24

Using the trunc function (our db is Oracle) made the time go back to midnight and then I just added 16 hours and for the second one, added a day plus 16 hours.

Thank you all for your ideas!
 
I think that's exactly what I suggested. OK, I forgot to mention to trunc(sysdate). Glad it's working.

Steve Krandel
Intuit
 
And I also can't do math. 16/24 = 2/3; not 3/4.

Never mind. I didn't help at all.

Steve Krandel
Intuit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top