HowTo: Sum a Price field where only some items need discount deducted

N

Neil

Hello,

I have a query that has a list of items - tblItems (fields are ID,
Description, Option No, Price, Deduct Discount). I have a form where the
user can select many items. I am trying to display the total list and total
nett prices in 2 textbox's on my forms. I can get the list total no problem
as i use DSum to add all the prices together from the price field. The nett
prices are a little different as some items can have discount deducted from
them and others cant. The deduct discount in my table is a yes/no field. How
can i get it to sum the price on all options and apply the discount
(discount is on the form in a textbox as a percentage) to the options where
discount is allowed? I think i may need a query to do this instead of using
the DSum funtion.

Any help is greatly appreciated.

TIA,

Neil.
 
B

Bill Taylor

I would use a query and calculate the field with the discount. I would also
set the default discount to 0 or use the nz function if you have null values
in the discount field where no discount is applicable.
 
N

Neil

Thanks Bill,

I created 2 queries - one with discount and one without. I then added the 2
together to get the total.

Cheers,

Neil.
 

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