djburnheim
Technical User
Not sure I'm putting this post in the right forum but hope somebody can help. I have a Informix database that I'm reporting on with three columns I'm trying to do calculations on but am having trouble...
agerecord.Secondstart - datetime
idrecord.Intialstart - datetime
agerecord.Length - integer (number of seconds)
My calculation would be :
agerecord.Secondstart - idrecord.Intialstart + agerecord.Length
But I can't workout how to do the calculations on datetime. I thought I might be able to use DATEDIFF but this doesn't seem to work. The select statement below returns the data I want and I can then do the calculation in Excel by converting all the dates to numbers but I would like to do the calculations when I query the database.
any suggestions?
Thanks
Dave
SELECT agerecord.Secondstart, idrecord.Intialstart, agerecord.Length
FROM informix.agerecord agerecord, informix.idrecord idrecord
WHERE agerecord.id = idrecord.id
AND ((idrecord.Intialstart Between {ts '2003-06-02 00:00:00'} And {ts '2003-06-03 00:00:00'})
agerecord.Secondstart - datetime
idrecord.Intialstart - datetime
agerecord.Length - integer (number of seconds)
My calculation would be :
agerecord.Secondstart - idrecord.Intialstart + agerecord.Length
But I can't workout how to do the calculations on datetime. I thought I might be able to use DATEDIFF but this doesn't seem to work. The select statement below returns the data I want and I can then do the calculation in Excel by converting all the dates to numbers but I would like to do the calculations when I query the database.
any suggestions?
Thanks
Dave
SELECT agerecord.Secondstart, idrecord.Intialstart, agerecord.Length
FROM informix.agerecord agerecord, informix.idrecord idrecord
WHERE agerecord.id = idrecord.id
AND ((idrecord.Intialstart Between {ts '2003-06-02 00:00:00'} And {ts '2003-06-03 00:00:00'})