Date comparison in SQL
Posted in 1994
In <matuscak-020594165521@zaphod.rohrer.com> matuscak@rohrer.com (Joe Matuscak) writes: > 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? > > > -- > Joe Matuscak > Rohrer Corporation > 717 Seville Road > Wadsworth, Ohio 44281 > (216)335-1541 > Matuscak@Rohrer.com 0 22 * * * /bin/su informix -c "echo \\"delete from userlog where timestamp < today - 180\\" | /usr/informix/bin/isql dbname" > /tmp/Cleanup.log 2>&1 this worked on a DEC Ultrix 5000/200 box (BSD). __________________________________________________________________ | Clem Akins Standard Disclaimers Apply | | Reynolds Metals Co. "Climb High, Cave Deep!" | | Alloys Plant (MS #59) | | 3509 East 2nd St Internet: cwakins@leia.rmc.com | | Muscle Shoals, Al Telephone: (205) 386-6783 | | USA 35661-1256 Facsimile: (205) 386-6831 | |________________________________________________________________|