If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Retrieving records from yesterday night and today morning everyday
Hi all,
How to write a SQL Query to retrieve count of records each day(by getting sysdate from the system) for records inserted between yesterday night and today morning?
providng you cna define what yesterday night and today morning is should be straightforward enough
have a look at the MySQL date/time functions
'all' you need to do is build the time banding appropriately
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Retrieving records from yesterday night and today morning everyday
I just want a query like this
select count(*) from table where stamp between (today @ 6 a.m) and (yesterday @ 8 p.m) and I want to use the sysdate for getting today's date as this task will run everyday at some particular time