Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Multiuser / Networking / March 2004

Tip: Looking for answers? Try searching our database.

Aggregate orders per salesman and year and month

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stefan Jansson - 17 Mar 2004 21:29 GMT
In a report I want to show the aggregate sales from January 1st this year
till now and at the same time his aggregate sales during the last month. All
information is in one table. I would be happy to know if someone could help
me solve this problem.

Regards
Steffie
Nikos Yannacopoulos - 18 Mar 2004 11:08 GMT
Stefan,

One way to do it is to use two separate queries, one for YTD and one for
MTD, the join the two on salesman in a third one and base your report on
that third one.
The first two queries must be Totals queries, with fields for Salesman,
Sales and calculated field(s) on Date.
Use Total function Group By on salesman, Sum on sales and Where on the
calculated field(s) on date.
YTD query requires one calc.field, e.g. MyYear: Year([datefield]), with
criterion Year(Date())
MTD query requires two calc. fields, one same as above and another for the
month, e.g. MyMonth: Month([datefield]), with criterion Month(Date()).
Them make a third query incorporating the previous two, join on salesman and
get the fields for salesman, YTD (SunOfSales from YTD) and MTD (SunOfSales
from MTD) in the grid. This is all you need for your report.

HTH,
Nikos

> In a report I want to show the aggregate sales from January 1st this year
> till now and at the same time his aggregate sales during the last month. All
[quoted text clipped - 3 lines]
> Regards
> Steffie
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.