Re: Help! SQL example needed for date comparison!

From: Jason Harris <jharris_at_westpac.com.au>
Date: 1997/12/09
Message-ID: <348dc86f.1962431_at_10.209.30.200>#1/1


My 0.02c worth

Try

where datetimefiled > date-1
and datetimefield < date

When you compare a datetime to a date if the datetime has the same date portion then it is considered greater.

I used this on v7.14 on NCR and it works.

Jason

On Wed, 26 Nov 1997 16:34:02 -0600, ah262_at_detroit.freenet.org wrote:

>
>
>Hello from Michigan!
>
>I am old-time "Big Iron" programmer, new to SQL and the Informix
>relational database, and am in need of some _simple_ sample code.
>
>I am in urgent need of some SQL sample code that takes a database
>DATETIME formatted field and compares it to the system date (minus one
>day) for equality. I am, in effect, attempting to pull the records from
>a table dated 1 day previous from the current system date. Sounds
>simple, eh? I've looked at using the various date functions that Informix
>provides, but each one is very specialized in the resulting value it
>produces.
>
>Unfortunately, all I have available to me is the Informix tutorial,
>reference, and syntax manuals, and none of these even come remotely close
>to defining the code for such a simple task.
>
>Any help you can provide would be most appreciated on this. If you know
>of any good SQL tutorial books with Informix hooks shown in it I would
>also appreciate knowing about those.
>
>Happy Thanksgiving!
>
>Todd
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Tue Dec 09 1997 - 00:00:00 CET

Original text of this message