At 15:23 -0500 2006/04/06, David Wolverton wrote:
I had this select statement run right at the midnight break...
SELECT.STATEMENT = 'SELECT TSE USING D.TSE WITH ACT.BATCH.STATUS = "EXTCOMP"
AND WITH COMPLETED # "COMP" OR WITH CALL.IN.DATE LE
"':OCONV(DATE(),'D4/'):'" AND WITH CALL.IN.TIME LE
"':OCONV(TIME(),'MTH'):'"' AND WITH COMPLETED # "COMP"'
...
My option now is to put this whole process to sleep for 10 seconds at 5
seconds to midnight!
If the process is one that runs and then quits, just use @DATE and
@TIME. They're constants for the whole time that the process runs.
If the SELECT is inside a loop, do something like:
NOW = TIME()
TODAY = DATE()
and use the variables in the SELECT. You're less likely to get
today's date with yesterday's time, and if you do cross midnight
between the NOW = and TODAY =, you'll be searching for records
created earlier than 23:59:59 today (23:59:5_ in the future), which
would include the records created just before midnight.
If that's OK, then you don't have to worry about today's date and
yesterday's time. If it still a problem, then I'd stick with the NOW
and TODAY variables, but SLEEP(3) and re-populate NOW (before
populating TODAY) if the time is GE 23:59.
Ray
--
.=================================================================.
| =-=-=-=-=-=-= Eagle Rock Information Systems Corp =-=-=-=-=-=-= |
| -=-=-=-=-=-=- web and database business solutions -=-=-=-=-=-=- |
| <http://www.eriscorp.com> <mailto:[EMAIL PROTECTED]> |
|Midwest Regional Office: 815-547-0662 (voice) 815-547-0353 (Fax)|
.=================================================================.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/