Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Month and day Summaries

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
GB
I have a table with the number of products sold by day in it.

I have queried it to give me a total of products sold by day. I have another query with the same fields but that gives me the total of products sold by month.

I need to be able to see the product with the daily total and the monthly total next to it so I can work out the daily percentage of the monthly total.

Can this be done?

Many thanks

Steven
 
Steven,

You could write a third query that joins the first two queries together by the date (on the daily query) and month (on the monthly query). For example:

FROM DailyTable INNER JOIN MonthlyTable ON DatePart("mmmm",DailyTable.Date) = DatePart("mmmm",MonthlyTable.Date)

What this does is say "if the name of the month that the daily date falls in matches the name of the month that the monthly date falls in, join them together."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top