Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
Sukumar Konduru <sukumar@gte.net> asked:
>I have a database column "date time year to second".
>I need to prepare SQL statement to do get the results for last
>24 hours.
>
>For example If current date and time are 06/02/98 10:25:00
>then I need query like this.
>
>select * from xxx
>where start <="1998-06-02 10:25:00"
>and>start >= "1998-06-01 10:25:00"
>
>I want to know in ESQLC or SQL
>1. How to find current date and time in "year to second"?
SQL: CURRENT YEAR TO SECOND
ESQL: dtcurrent()
>2. How to mainpuate above to get date for exactly for 24hours back ?.
Well, simply write what you asked for:
SELECT *
FROM xxx
WHERE Start BETWEEN CURRENT YEAR TO SECOND - 24 UNITS HOUR
AND CURRENT YEAR TO SECOND;
Yours,
Jonathan Leffler (jleffler@informix.com) #include <returned.h>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.