Selasa, 23 Juni 2015

Re: [MS_AccessPros] Count total records between dates

 

Arthur-


Like this:

SELECT Count(SV00300.Service_Call_ID) AS Total_WorkOrder, SV00300.Status_of_Call
FROM SV00300
WHERE (((SV00300.Date_of_Service_Call) Between #5/1/2015# And #5/31/2015#));
GROUP BY SV00300.Status_of_Call;

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jun 23, 2015, at 7:31 PM, dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:


I am trying to get a total number of records per category between two dates but I am not doing something right. Here is what I have so far.


SELECT Count(SV00300.Service_Call_ID) AS Total_WorkOrder, SV00300.Status_of_Call
FROM SV00300
GROUP BY SV00300.Status_of_Call, SV00300.Date_of_Service_Call
HAVING (((SV00300.Date_of_Service_Call) Between #5/1/2015# And #5/31/2015#));


This is returning total records for every status between the two dates,



Query1
CountOfService_Call_ID Status_of_Call
8 OPEN
1 OPEN
12 OPEN
7 OPEN
10 OPEN
5 OPEN
7 OPEN
4 OPEN
12 OPEN
6 OPEN
8 OPEN
5 OPEN
12 OPEN
10 OPEN
8 OPEN
11 OPEN
4 OPEN
1 OPEN
12 OPEN
6 OPEN
7 OPEN
3 OPEN


What I am trying to get is


Total           Status

345             OPEN


Any ideas?


Thank you,


Arthur Lorenzini

Sioux Falls, SD


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar