Re: [Q] Frusturating SQL question
Posted in 1996
RTFM: CURRENT YEAR TO MINUTE would give you the current time. It isn't clear that that is what you want, however. Given that you are running at or after midnight, you probably want the date to be yesterday's, so I'd be using: EXTEND(lastmod, YEAR TO DAY) = (CURRENT YEAR TO DAY - 1 UNITS DAY) This only compares the YEAR, MONTH and DAY components (critical), and does it for yesterday. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: Saqib Mausoof <ssmaus@ccmail.monsanto.com> }Date: Tue, 27 Feb 1996 12:19:47 -0600 }X-Informix-List-Id: <news.21605> } }I hope someone can help me out of this frustaration. I have a }tbale in Informix 5.01 that hold information for visitors to our }site. I need to print out a simple report which shows the number }of visitors and their time of arrival at midnight everday. A }simple cron job unloads my query into an ascii file and with a }little awk manipulation I print the file to the remote site. } }Unfortunately, I can't get my SIMPLE query to work. My date }column is LASTMOD (DATETIME YEAR TO MINUTE) and I need to get }data for just one day. My query is } }Select lname, fname, vendor, status, lastmod }from visitors }where lastmod = TODAY (YEAR TO MINUTE) }order by 3,2,1 } }This does not work, obviously. But what does work? Any ideas?