specific day!!

rockyjr

Registered User.
Local time
Today, 16:56
Joined
Mar 12, 2008
Messages
100
Hi everyone,

I have a call tracking database. I'm looking to write a query that would give me the total calls on a specific day. What I have right now is a query that calculates total calls between dates per month. What I want to enhance to this query is to be able to specify a specific day (Mondays, Tuesdays... etc...) or to be able to select ALL Days.

This is what I have :
Code:
SELECT Format([opened date],'mmm yyyy') AS [Month Year], Count(*) AS TotalsCalls
FROM calls
WHERE (((calls.[opened date]) Between [StartDate] And [EndDate]))
GROUP BY Format([opened date],'mmm yyyy')
ORDER BY Format([opened date],'mmm yyyy');
 
If you wanted to return all the monday's then you would do this...

SELECT Format([opened date],'mmm yyyy') AS [Month Year], Count(*) AS TotalsCalls
FROM calls
WHERE (((calls.[opened date]) Between [StartDate] And [EndDate])
AND (WeekDay(calls.[opened date])=2))
GROUP BY Format([opened date],'mmm yyyy')
ORDER BY Format([opened date],'mmm yyyy');

Note, the Weekday function considers Sunday as 1, Monday as 2, etc...
 
Sweet, thank you very much!

Luc
 
if 1 to 7 are for specific days, is there a value for all days?
 

Users who are viewing this thread

Back
Top Bottom