# Thread: Calculations between currency and number??

1. Registered User
Join Date
Nov 2003
Posts
150

## Unanswered: Calculations between currency and number??

Hi,

I need to perform some calculations between an item price ( currency format ) and a discount. Can the format of discount be 'general number' and be able to perform the correct calculations?? The formula i want to use is this:

extendedprice = itemprice * quantity * (1 - discount )

i think so, but i want to make sure....

thanks!

2. Grand Poobah
Join Date
Sep 2003
Location
MI
Posts
3,713
Yes. "General Number" doesn't mean much ... What is the type of the discount?

3. Registered User
Join Date
Nov 2003
Posts
150
I would like to use a %.

The user would enter 5 for a 5% discount. So far, i've built the form and put the textbox for curExtendedPrice in the footer with the Bafore_Update event filled with

=tblOrderDetails!curUnitRetail-((100-tblOrderDetails!intDiscount)/100)*tblOrderDetails!intQuantity

So far, it doesnt work, i get #Name? in the curExtendedPrice textbox

Thanks for the help!

4. Registered User
Join Date
Nov 2003
Posts
150
Sorry, i realise that what i meant to say is that i want to use an integer, not a %........

5. Registered User
Join Date
Nov 2003
Posts
150
I think i got it.....

Instead of using a table for the source data of the form, i'm using this query:

SELECT tblOrderDetails.intOrderID, tblProductInfo.intProductID, tblProductInfo.strProductName, tblProductInfo.curUnitRetail, tblOrderDetails.intQuantity, tblOrderDetails.intDiscount, CCur(tblProductInfo.curUnitRetail*[intQuantity]*(100-[intDiscount])/100) AS curExtendedPrice
FROM tblProductInfo, tblOrderDetails
ORDER BY tblOrderDetails.OrderID;

Now, the only thing i'm missing is a way to only display the records of 1 orderID at a time, preferably, the orderID displayed in the main form

Orderdetails is a subform on the Orders form.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•