access SQL query - group by date range (after midnight problem) -


need populate list of days # of recordings each day grouped day. here problem: data recorded after midnight going next day: need go previous day .

i tried this:

select recordedondate, count(recordedondate) rowcount, count(songid) [total amount] infotable (recordedondate > dateadd('h', 5, #1/23/2011#)) , (recordedondate < dateadd('h', 5, #1/24/2011#)) group recordedondate order recordedondate desc 

but cannot group thanks

what want offset times 5 hours "appear" on previous day.

select     dateadd('h', -5, recordedondate) recordedondate,     count(recordedondate) rowcount,     count(songid) [total amount] infotable (recordedondate > dateadd('h', 5, #1/23/2011#)) , (recordedondate < dateadd('h', 5, #1/24/2011#)) group dateadd('h', -5, recordedondate) order recordedondate desc 

fix clause require, group 5am 5am next day "today"


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -