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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding hours and minutes to a date in Impromptu

Status
Not open for further replies.

nishantu

Programmer
May 30, 2003
7
0
0
IN
My oracle database table has two fields [EST date, EHR varchar2(5)]. The data in EST includes time, for example '02/28/2000 8:27 PM'. The data in EHR would a string representing hours and minutes for example '10:11'.

In my impromptu report I need to add EHR to EST and display a new datetime. In the above example, ECT would be '02/29/2000 6:38 AM'

What is the best way to do this?

Thanks,
Nishant
 
I've never tried to do this (but I'm sure I will in the future) and you're right. Functions may refer to DateTime, but this is mainly a formatting or data type issue. The only way I can see of doing the sort of thing you want uses values not variables.
I'd really be interested if anyone else has any better ideas, but all I can think of is to extract the Year, Month, Day, Hours and Minutes into variables and then write a calculation which put works out the new date & time and puts the result in as a string. It may be better to do this in the catalog.
However in your case it may be simpler to do the calculation in Oracle and map the result to the catalog!
Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top