Connecting Tech Pros Worldwide Help | Site Map

Only add Valid Payments on a Report.

simonmarkjones@gmail.com
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi,

In a Report I add up amounts payed in on a certain date.
="£" & Sum([PaymentAmount])

I have just added a field called Void to the table this is a check box
data type yes/no.

The report shows a check box next to each each payment to show if it is
void or not.

What i would like to do is only add up the payments into the total text
box and dont add the void entries to this.

Do i have to do this within the initial query?

The query is called Print All Income and the fields within this query
are PaymentAmount and Void.

I tried to solve this myself but i'm am new to SQL. What i did was to
add a new field to the query called totalOfPaymentAmmounts
then tried doing the following
Select([PaymentAmount]FROM[Print All Income]WHERE[Void]=false)

I know this isnt right but am i on the right lines and can someone help
me.
Thankyou in advance!

Tom van Stiphout
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Only add Valid Payments on a Report.


On 7 Sep 2005 05:28:00 -0700, simonmarkjones@gmail.com wrote:

I would use the DSum function:
=DSum("PaymentAmount" "[Print All Income]", "Void=false")

-Tom.

[color=blue]
>Hi,
>
>In a Report I add up amounts payed in on a certain date.
>="£" & Sum([PaymentAmount])
>
>I have just added a field called Void to the table this is a check box
>data type yes/no.
>
>The report shows a check box next to each each payment to show if it is
>void or not.
>
>What i would like to do is only add up the payments into the total text
>box and dont add the void entries to this.
>
>Do i have to do this within the initial query?
>
>The query is called Print All Income and the fields within this query
>are PaymentAmount and Void.
>
>I tried to solve this myself but i'm am new to SQL. What i did was to
>add a new field to the query called totalOfPaymentAmmounts
>then tried doing the following
>Select([PaymentAmount]FROM[Print All Income]WHERE[Void]=false)
>
>I know this isnt right but am i on the right lines and can someone help
>me.
>Thankyou in advance![/color]

simonmarkjones@gmail.com
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Only add Valid Payments on a Report.


Great thankyou for that!

It works on the computer screen on the Report. However, If you try and
print this all i get is the £ printed out. Any ideas??

Thanks for your help.

simonmarkjones@gmail.com
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Only add Valid Payments on a Report.


Found the solution. I was putting ="£" & DSum("PaymentAmount" "[Print
All Income]", "Void=false")
on the Report in a Label. This worked fine except for when it came to
printing the report.

What i have now done is to create another field in my query
eg. TotalPayments:DSum("PaymentAmount" "[Print All Income]",
"Void=false")

Then on the Report all i had to do was... ="£" & [TotalPayments]

Yay!
ROCKIN!
Cheers Simon
www.simonband.co.uk

Closed Thread


Similar Microsoft Access / VBA bytes