Find Total Number of Payment Made in a Month Query (1 Viewer)

JithuAccess

Member
Local time
Yesterday, 19:07
Joined
Mar 3, 2020
Messages
297
Hello Guys,

In my Table I have a field Payment Date. I want to find the Count of Payments made in a month. This is the data in my Table:

1619542548595.png


I want to display like this in my Query:

1619542664466.png


This is my Query:
1619542886189.png


And this is my Query Result:

1619542909999.png


Could you please let me know how to Fix this?

Thanks
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 21:07
Joined
Jan 23, 2006
Messages
15,379
Can you post a copy of the database?

You could try
Month:Format([datPayment Date],"MMM-YY")
 

plog

Banishment Pending
Local time
Yesterday, 20:07
Joined
May 11, 2011
Messages
11,646
You've got 2 issues--Month formatting and missing data. jdraw's code fixes the formatting issue. To fix the other issues you need a data source that covers the period you want to report on. You can't create records in a query if there are no records in the underlying datasource the query is built on.

Do you have a table that has every month/year you want to show in your query? If not, you should build one. It would look like this:

ReportMonths
ReportMonth
"Apr-20"
"May-20"
"Jun-20"
...


Then you can build a query using it and LEFT JOIN your other table to achieve what you want.

 

JithuAccess

Member
Local time
Yesterday, 19:07
Joined
Mar 3, 2020
Messages
297
Can you post a copy of the database?

You could try
Month:Format([datPayment Date],"MMM-YY")

Hi,

Thanks a lot. Now I am getting like:

1619556497120.png


Two issues: I want to sort this data by Month. Like Apr-20, May-20, Jun-20...Mar-21 Second issue, though there isn't any Record for May I want to show like

Month Total
----------- -------
May-20 0

I am attaching the Database.

Thanks so much for your help.
 

Attachments

  • Test.accdb
    640 KB · Views: 210

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:07
Joined
May 7, 2009
Messages
19,237
see Query3.
 

Attachments

  • Test.accdb
    768 KB · Views: 193

Users who are viewing this thread

Top Bottom