Selasa, 05 Juli 2016

[MS_AccessPros] Re: Counting dates in a month

 


Hi Art

Remove tblTenantListing.MOVEINDATE from the GROUP BY.  Having it there causes a new aggregate record for every different date.

You will probably also need to change HAVING to WHERE.

Best regards,
Graham Mandeno [Access MVP 1996-2015]

---In MS_Access_Professionals@yahoogroups.com, <dbalorenzini@...> wrote :

I am trying to count the number of records by month.


SELECT Format([MOVEINDATE],"mmmm"" , ""yyyy") AS [Month of Move-In], Count(tblTenantListing.ID) AS [Total Move-In]
FROM tblTenantListing
GROUP BY Format([MOVEINDATE],"mmmm"" , ""yyyy"), tblTenantListing.MOVEINDATE
HAVING (((tblTenantListing.MOVEINDATE) Between #10/1/2015# And #6/30/2016#));


Currently this gives me the following:


Query1
Month of Move-InTotal Move-In
April , 20161
April , 20161
April , 20161
April , 20161
April , 20161
April , 20162
December , 20151
December , 20151
December , 20151
February , 20163
February , 20161
February , 20161
February , 20161
February , 20161
January , 20161
January , 20161
January , 20161
January , 20161
March , 20164
March , 20161
March , 20161
March , 20161
March , 20161
May , 20161
May , 20161
May , 20161
May , 20161
November , 20151
November , 20151
November , 20151
November , 20151
October , 20151


What I actually need is one record per month. Any ideas?


THank you,


Arthur Lorenzini

Sioux Falls, SD

__._,_.___

Posted by: graham@mandeno.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar