Discussion Locked

Expression Building in Access 2000

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

What is the expression for to isolate dates within a table and maintain subsequent fields in order to total figures for a month on one i/d.
id=1
Date 1=01/01/03 Price 1=?1
Date 2=02/01/03 Price 2=?2
Date 3=01/02/03 Price 3=?2
Total Jan=Expression?

5 replies

by eschlangen

IF I understand your question correctly, and I'm not sure that I do, you are looking for a query that will give you the total price for January for ID 1. I'm assuming that your table structure is more like this:

ID DATE PRICE(?)
1 01/01/03 1
1 02/01/03 2
1 01/02/03 2

If this is correct, the query would read like this:

SELECT SUM(PRICE) FROM TableName WHERE ID = 1 AND MONTH(DATE) = 1;

If you switch to SQL view, type this in and then change back to grid view, itwill be easier to see but it's hard to show here. Hope this helps!

by d_e_pinder

I am looking for an expression that will total all of the prices for a particular month for that id number.

by eschlangen

My query DOES give a total of the prices for a given ID for a given month. You must not be stating your problem correctly.

by d_e_pinder

It is probably not the question or the answer, but the way I've established the fields within the table. Your answer has given me the direction,I think, that I need to take to achieve the aim. If I need to resubmit the question it would be nice to be able to paste an example of the table in so that i can be advised on the best method to achieve the total
Thanks.

This discussion is closed to new replies.