MTD and YTD Totals

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
786
Office Version
  1. 365
I have an sales & charges database, so they will enter every day sales and charges and then run a reports every day, how can show in my report the mtd and ytd totals?

here my report query:

Code:
SELECT Transactions.SelectedPrint, Transactions.TransactionDate, Transactions.TransactionID, Transactions.EmployeeID, [Transactions Details].TransactionID, [Transactions Details].CodeID, [Transactions Details].Amount, CodesCategory.CodeCategoryID, CodesCategory.CategoryName, DateAdd("m",1,DateSerial(Format([TransactionDate],"y"),Format([TransactionDate],"m"),1))-1 AS EOMonth
FROM CodesCategory INNER JOIN ((Transactions INNER JOIN [Transactions Details] ON Transactions.TransactionID = [Transactions Details].TransactionID) INNER JOIN Codes ON [Transactions Details].CodeID = Codes.CodeID) ON CodesCategory.CodeCategoryID = Codes.CodeCategoryID
WHERE (((Transactions.SelectedPrint)=Yes));
thank you
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
J,

This might not be the most efficient answer, but seeing as no one has answered yet, I will throw my two cents in.

I would create another query that limits the records retrieved by whatever the date field is. In the query you can use the sum button to get a total for the query and reference that total in the report.

Something like
Code:
(Month([thisIsTheDateField]) = Month(Date())) AND (Year([thisIsTheDateField]) = Year(Date()))
would be your limiting string in the query (this is not even close to the string you will need - it is hard for me to figure exactly what unless I am looking and playing around with it).

And not quite sure how to reference the sum that you get from the query, though I am sure there are resources out there for that.

Hope I have given you some direction. If not, well, at least I bumped the thread up for you!
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,920
Latest member
jaspers

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top