DSum - running total

R

RL

Morning,

I have a table which contains a record of every transaction we process. That
table contains the following 2 fields, [trdate] and [amount] for the date and
value of each transaction.

I want to run a query which tells me the sum of each day's transactions and
a running total of all days to date.

To that end, I have created a select query with the following 3 columns:
1. [trdate]; Group by; Ascending; Visible
2. Total: [amount]; Sum; - ; Visible
3. RunTot: DSum("[amount]","t_SLTransactions","[trdate]<=[trdate]");
Expression; - ; Visible

At the moment, every record is returning the same figure - the sum of ALL
transactions.

However, I want it to be a running total - i.e the first record will show
the same for Total and RunTot; in the second record, the RunTot will be the
sum of the first two records' totals. Etc.

Have you any idea what I'm doing wrong?

RL
 
B

bcap

3. RunTot: DSum("[amount]","t_SLTransactions","[trdate]<= #" &
Format([trdate],"mm/dd/yyyy") & "#");
 
R

RL

Legend! Thank you very much.

bcap said:
3. RunTot: DSum("[amount]","t_SLTransactions","[trdate]<= #" &
Format([trdate],"mm/dd/yyyy") & "#");

RL said:
Morning,

I have a table which contains a record of every transaction we process.
That
table contains the following 2 fields, [trdate] and [amount] for the date
and
value of each transaction.

I want to run a query which tells me the sum of each day's transactions
and
a running total of all days to date.

To that end, I have created a select query with the following 3 columns:
1. [trdate]; Group by; Ascending; Visible
2. Total: [amount]; Sum; - ; Visible
3. RunTot: DSum("[amount]","t_SLTransactions","[trdate]<=[trdate]");
Expression; - ; Visible

At the moment, every record is returning the same figure - the sum of ALL
transactions.

However, I want it to be a running total - i.e the first record will show
the same for Total and RunTot; in the second record, the RunTot will be
the
sum of the first two records' totals. Etc.

Have you any idea what I'm doing wrong?

RL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top