Working in Access 2000.
A table records, among other things, the date a transaction was entered, and two currency fields. The goal is to Sum the two currency fields based on their common dates. So, for example, let's say I had three entries all occurring on 2/1/10:
Example A
1) field1: $5.00, field2: $15.00
2) field1: $10.00, field2: $0.00
3) field1: $5.00, field2: $10.00
I have written a query that will Sum field1 and field2 based on examination of the date the transactions were entered. I use... DateDiff('d',[session_date],Date()) and set the where condition to zero. So if today were 2/1/10, the output of the query would be as follows:
Example B
field1: $20.00 / field2: $25.00
All well and good, however, I'd like this query to work for every date in the table, not just today's date. If I simply run the query without a Where condition and Sum the two fields and set the session_date field to GroupBy, I don't get a sum of the sessions for a given date, but instead get the individual records for every date. In other words, if I ran the query today (2/18/2010) as I just described, the output I would get for the transactions dated 2/1/10 would look exactly like Example A, and not Example B, which is the goal.
This seems like it ought to be an easy issue to resolve (I haven't yet gone to VB coding to address the issue) using existing Access functions, but I'm stumped. Any ideas....?
"There is no spoon..." - anonymous enlightened child
A table records, among other things, the date a transaction was entered, and two currency fields. The goal is to Sum the two currency fields based on their common dates. So, for example, let's say I had three entries all occurring on 2/1/10:
Example A
1) field1: $5.00, field2: $15.00
2) field1: $10.00, field2: $0.00
3) field1: $5.00, field2: $10.00
I have written a query that will Sum field1 and field2 based on examination of the date the transactions were entered. I use... DateDiff('d',[session_date],Date()) and set the where condition to zero. So if today were 2/1/10, the output of the query would be as follows:
Example B
field1: $20.00 / field2: $25.00
All well and good, however, I'd like this query to work for every date in the table, not just today's date. If I simply run the query without a Where condition and Sum the two fields and set the session_date field to GroupBy, I don't get a sum of the sessions for a given date, but instead get the individual records for every date. In other words, if I ran the query today (2/18/2010) as I just described, the output I would get for the transactions dated 2/1/10 would look exactly like Example A, and not Example B, which is the goal.
This seems like it ought to be an easy issue to resolve (I haven't yet gone to VB coding to address the issue) using existing Access functions, but I'm stumped. Any ideas....?
"There is no spoon..." - anonymous enlightened child