Converting Integer into a Date / Time and Calculating Elapsed time
Posted in 2000
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
I have an Informix Database that has a Creation Date of a Help Desk Ticket in an integer format that represents the number of seconds from 01/01/1970. It is stored in an integer field . I'm trying to write a 4gl report to: 1. Calculate and display the integer into a date / time format. 2. Calculate the elapsed time in day / hour / seconds from the date of creation to the current date / time. Has anybody already developed the algorithm and procedure to do this? Thanks for your assistance. Orlando
og wrote: > I have an Informix Database that has a Creation Date of a Help Desk Ticket > in an integer format that represents the number of seconds from 01/01/1970. > It is stored in an integer field . I'm trying to write a 4gl report to: > > 1. Calculate and display the integer into a date / time format. > 2. Calculate the elapsed time in day / hour / seconds from the date of > creation to the current date / time. > > Has anybody already developed the algorithm and procedure to do this? > > Thanks for your assistance. > Orlando DEFINE start_date YEAR TO SECOND DEFINE tickect_date YEAR TO SECOND DEFINE ticket_time INTEGER DEFINE elapsed_time INTERVAL YEAR TO SECOND LET start_date ="01-01-1970 00:00:00" LET ticket_date = start_date + ticket_time UNIT SECONDS LET elapsed_time= CURRENT - ticket_date -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible, and Connection to other RDBMS such as Oracle. Hydra 4GL Compiler (Compatible with I4GL) Compile once, run everywhere Phoenix Windows GUI. (Front End to 4GL) Chimera Java GUI The only GUI you will ever need... (Front End to 4GL) Arachne Web Technology (Front End to 4GL on the Web & HTML Report Generator) ESQL/C Compiler For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------