Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2007
    Posts
    7

    Unanswered: matching records to 3 decimal places

    Hi Guys,

    I have written a select query which checks the price we have charged a customer for a call against what it should cost.

    I have my query running fine but i have a small problem where some of my records are to more than three decimal places but the data i am searching against only has a maximum of three which means it is showing up slight differences which i really would like to avoid.

    The way my query works is i have a call price, a connection fee and a duration which i am matching against the price per second so:

    select table1*
    from table1 innerjoin table2 on
    call price-connection fee/duration = price per second.

    I have also added an extra field at the select which shows what the price of the call should be and that is what i am using to compare.


    i will give you an example:

    the price of the call we charge the customer is 0,272 but when the calculation is done on what the price should be the price is 0,271995.
    So effectively i would like the query to round this number to 0,272 and then compare!

    Sorry for the long winded ness but ive been rooting through the help screens all day and am at my wits end lol!!

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    In your query, right-click on the offending field and select Properties. This gives you a box to fill in. On the line for Decimal Places type in 3, save the query, and good luck.

    HTH,
    Sam

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Take a look at the Round() function in Access...
    George
    Home | Blog

  4. #4
    Join Date
    Jun 2007
    Posts
    7

    thanks

    thanks guys ill have a look at it today and see how i get on, might still need your help though

  5. #5
    Join Date
    Jun 2007
    Posts
    7

    it worked!

    just a wee note of thanks to both of you, in the end i used the round function and it works perfectly!!

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Thank you for your thanks
    Glad that we could help you out!
    George
    Home | Blog

  7. #7
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Ditto!

    Sam

Posting Permissions

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