RE: HELP - How to Do this Query?
Posted in 1997
Yan/Dragi
How about this query?
SELECT * FROM table
WHERE (datecol + 10) >= '97/10/10'
AND (datecol - 10) <= '97/10/10'
Make sure your DBDATE environment variable is set (in your case YMD2/).
HTH
Sujit Pal
----------
From: Dragi Raos[SMTP:bonzi@4mate.hr]
Sent: Thursday, October 23, 1997 4:45 PM
To: informix-list@rmy.emory.edu
Subject: Re: HELP - How to Do this Query?
Yan Liu wrote:
>
> We have a DATE field of a table. Now I need to select all the records
> around a day. For example between "97/10/10" - 10 days and "97/10/10" +10 days.
> How shall I write the WHERE statement?
>
> I know it would be easy for a datetime field by using 10 UNITS DAY.
> But what to do for DATE field? Any body have any ideas? Thanks!
>
> --
> Yan
Also take a look at INTERVAL funsction (or whatever it is).
Dragi "Bonzi" Raos
+--------------------------------------------------------+
| 4-MATE Information Engineering Inc. |
+--------------------------+-----------------------------+
| 4-MATE | Tel: +385 (1) 242-116 |
| Kosa bb | +385 (1) 242-126 |
| 10000 Zagreb | Fax: +385 (1) 242-121 |
| Hrvatska (Croatia) | e-mail: bonzi@4mate.hr |
| | URL: http://www.4mate.hr |
+--------------------------+-----------------------------+