Monthly sales

musaad

New member
Local time
Today, 13:47
Joined
Apr 18, 2014
Messages
7
I have a table with daily sales figures as below. I need a quarry in access to display January and February sales in a text boxes

Date Revenue
1/1/14 $200
2/1/14 $100
3/1/14 $50
4/1/14 $100
1/2/14 $200
2/2/14 $400
3/2/14 $100
4/2/14 $150

How can I solve this.
 
I need a quarry in access to display January and February sales in a text boxes

That doesn't really make sense: queries don't have text boxes, they just have fields. Also, 'Date' is a poor choice for a field name because it's a reserved word in access and makes writing queries and code difficult. I suggest you rename that field and prefix it with what that date represents (i.e. Sales_Date).

If, you want a query that aggregates and sums your data by month, check out this link that describes how to write such a query: http://support.microsoft.com/kb/290136
 
SLDate Revenue
1/1/14 $200
2/1/14 $100
3/1/14 $50
4/1/14 $100
1/2/14 $200
2/2/14 $400
3/2/14 $100
4/2/14 $150

Okay sorry about it... I have a table call tbl.sales in this table I have columns SL_ID, SL_Date, Revenue. I need to display the total revenue for the month of January and February. is there a easy way I can do it..
 
As long as Revenue is some sort of numeric field (Long Integer, Currency). This SQL will do it:

Code:
SELECT Month(SLDate) AS SalesMonth, Year(SLDate) AS SalesYear, SUM(Revenue) AS MonthlySales
FROM tbl.sales
WHERE Month(SLDate)<3
GROUP BY Month(SLDate), Year(SLDATE)
 
As long as Revenue is some sort of numeric field (Long Integer, Currency). This SQL will do it:

Code:
SELECT Month(SLDate) AS SalesMonth, Year(SLDate) AS SalesYear, SUM(Revenue) AS MonthlySales
FROM tbl.sales
WHERE Month(SLDate)<3
GROUP BY Month(SLDate), Year(SLDATE)

Thank Plong now it works....
 

Users who are viewing this thread

Back
Top Bottom