DSum or?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear gurus, Need your help again,

I have a transaction table (T_Transactions) where I use it to record Bank
transactions (TrID, TrDate, CreditAmount and DebitAmount.
I want to create a report to print the balances of this Account. I have
added an unbound object ([CreditAmount] - [DebitAmount]) which works OK
(giving me the correct balance after each transaction) when I use a filter to
print a report of a specific date range (not starting from the first
transaction) this does not work. How can I do that? Shall I use a DSum or
what?
Thanks in advance
 
You should be able to place a text box in the Report Footer section (not the
Page Footer), and set the Control Source of the text box to:
=Sum([CreditAmount] - [DebitAmount])

That will limit the sum to those values that are shown in the report. DSum()
would be more difficult and less efficient.
 
Dear Allen, Thanks a lot for your prompt answer,

The problem is that when I select a date range i.e 1st May - 31 May will
only sum up only the transactions done in May - What about the previous
transactions? What I want to print is a report like the one we get from the
Banks (account statement)
Any further ideas?
TIA

Ο χÏήστης "Allen Browne" έγγÏαψε:
You should be able to place a text box in the Report Footer section (not the
Page Footer), and set the Control Source of the text box to:
=Sum([CreditAmount] - [DebitAmount])

That will limit the sum to those values that are shown in the report. DSum()
would be more difficult and less efficient.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George said:
Dear gurus, Need your help again,

I have a transaction table (T_Transactions) where I use it to record Bank
transactions (TrID, TrDate, CreditAmount and DebitAmount.
I want to create a report to print the balances of this Account. I have
added an unbound object ([CreditAmount] - [DebitAmount]) which works OK
(giving me the correct balance after each transaction) when I use a filter
to
print a report of a specific date range (not starting from the first
transaction) this does not work. How can I do that? Shall I use a DSum
or
what?
Thanks in advance
 
Okay, if you do want to sum *all* transactions, not those in the report,
then DSum() makes sense.

Assuming the report has a field for the Account:

=DSum("[CreditAmount] - [DebitAmount]", "T_Transactions", "[Account] = " &
[Account])

If Account is a text field, you need extra quotes:
http://allenbrowne.com/casu-17.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George said:
Dear Allen, Thanks a lot for your prompt answer,

The problem is that when I select a date range i.e 1st May - 31 May will
only sum up only the transactions done in May - What about the previous
transactions? What I want to print is a report like the one we get from
the
Banks (account statement)
Any further ideas?
TIA

? ??????? "Allen Browne" ???????:
You should be able to place a text box in the Report Footer section (not
the
Page Footer), and set the Control Source of the text box to:
=Sum([CreditAmount] - [DebitAmount])

That will limit the sum to those values that are shown in the report.
DSum()
would be more difficult and less efficient.

George said:
Dear gurus, Need your help again,

I have a transaction table (T_Transactions) where I use it to record
Bank
transactions (TrID, TrDate, CreditAmount and DebitAmount.
I want to create a report to print the balances of this Account. I
have
added an unbound object ([CreditAmount] - [DebitAmount]) which works OK
(giving me the correct balance after each transaction) when I use a
filter
to
print a report of a specific date range (not starting from the first
transaction) this does not work. How can I do that? Shall I use a
DSum
or
what?
Thanks in advance
 
Back
Top