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

converting oracle dates in impromptu

Status
Not open for further replies.
Sep 20, 2002
20
GB
Hi,

whats the best method of converting an Oracle date e.g. seconds from 01/01/1970 to a date/datetime in cognos impromtu 6 (version 6.0.506.0)?

I currently use the following function (which I inherited from the bloke who had my job before me)...

datetime-to-date(days-from-1900-to-datetime((order_date/86400)+25568))

but this is inaccurate e.g. 1082415000 (19/04/04 22:50:00) converts to 20/04/04 but 1082414820 (19/04/04 22:47:00) converts to 19/04/04

This is due to it rounding the resultant division of the date by 86400 to only one decimal place. Is there anyway to specify for the system to round to x decimal places rather than just one?

Answers A.S.A.P. cheers
 
ur table contains seconds since 1700 or date value?
if it is a date, where is the problem? why u want to convert into seconds since that date and do something something?
regards,
sudhi
 
The problem is that during the date conversion Impromptu rounds the calculation to 1 decimal place... thus making the date conversion inaccurate...
 
I solved the problem myself, though its a bit of a cludge. The formula is now...


datetime-to-date(days-from-1900-to-datetime((order_date/86400)+25568.001))

which forces the number of decimal places I need for it to be accurate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top