Simple Date Query

  • Thread starter Thread starter Joe Spenceley
  • Start date Start date
J

Joe Spenceley

Hi,

I have a field which is general date and contains dd//mm/yy hh:mm:ss.

I want to count number of records for each date.

e.g. something like

SELECT Count(Messages.MessageID) AS CountMessage, Messages.DateStamp
FROM Messages
GROUP BY Messages.DateStamp;

This groups by the time rather than the date. I've looked at using DatePart
to construct a query but that is looking rather clumsy. Is there a more
efficient way of doing this?

Cheers,
Joe
 
Joe said:
I have a field which is general date and contains dd//mm/yy hh:mm:ss.

I want to count number of records for each date.

e.g. something like

SELECT Count(Messages.MessageID) AS CountMessage, Messages.DateStamp
FROM Messages
GROUP BY Messages.DateStamp;

This groups by the time rather than the date. I've looked at using DatePart
to construct a query but that is looking rather clumsy.


Try:

GROUP BY DateValue(DateStamp)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Date Function in query 3
Sum query 5
Query to Update Date 2
Cross-tab Criteria not evaluating 19
Date format 1
Date Parameter 7
Query Based on Weekdays vs Weekend 4
Date/time query 1

Back
Top