Results 1 to 5 of 5
  1. #1
    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!
    Cheers!

    Mr.Crud

    There are 10 kinds of people, ones that understand digital, others that dont

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

  3. #3
    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!
    Cheers!

    Mr.Crud

    There are 10 kinds of people, ones that understand digital, others that dont

  4. #4
    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 %........

    my bad for not re-reading my post...
    Cheers!

    Mr.Crud

    There are 10 kinds of people, ones that understand digital, others that dont

  5. #5
    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.
    Cheers!

    Mr.Crud

    There are 10 kinds of people, ones that understand digital, others that dont

Posting Permissions

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