Date comparison in SQL
Posted in 1994
Billy Wheeler — — source: Informix-list mailing list archive (1991-1998)
To: matuscak@rohrer.com
who wrote:
JM> Hi. Ive got a table that is used for logging information about when a
> program is run. Among other things, its got a date field in it. Id like to
> have my nightly cron job run some SQL that basically says "delete from
> userlog where timestamp is older than 6 months". Can someone shed some
> light on how to do that?
How about:
DELETE FROM userlog WHERE timestamp < today - 183
?
Regards,
billy.wheeler@digitec.co.za
---
. SPEED 1.40 [NR] . (A)bort, (R)etry, (I)nfluence with large hammer
----
Digitec Online - 20 Nodes * Johannesburg, South Africa +27-11-476-2008
* Best BBS * Best Sysop *
@digitec.co.za * RsaNET User Choice Awards 1993 *