Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    182

    Unanswered: no of decimals in calculated field

    I have the following query
    SELECT est_id, prepby, quantity, partname, Partno, matcost, setcost, runcost, extra, externalcost, cexternalcost, cmatcost, csetcost, cruncost, cextra, unitcost,
    unitquote, custom, ROUND(matcost * mfactor + matcost, 2) AS MatPrice, ROUND(cmatcost * mfactor + cmatcost, 2) AS MatIPrice, mfactor, Revision,
    totalhours, jotter
    FROM SQLACCESS.tblctest

    My problem is the output for MatPrice and MatIPrice has 4 numbers after the decimal I only want 2. I have tried changing the text box it is displayed in and changing the scale of the mactcost etc fields but nothing seems to work.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    when you say you have tried but nothing seems to work, what have you tried
    What control are you using to display the data (on a form or a report)
    Assumning you are using a text box control the relevant fields are onthe format tab
    look for to format AND NoDecimals entries (the first to rows)
    Set format to Standard or Fixed
    AND
    NoDecimals to 2 should get you there.

    Note the underlying value remains to whatever precision the underlying data type is. So you can have rounding errors on aggregation and summary values
    Last edited by healdem; 12-16-04 at 09:08.

  3. #3
    Join Date
    Apr 2004
    Posts
    182
    it is a text box in a report format fixed, decimals 2 but it still shows as 24.3400 etc
    I have changed the format of the textbox to currency to test it and it doesn't pick that up either.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    did you also set the format to "STANDARD" or "FIXED"?

  5. #5
    Join Date
    Apr 2004
    Posts
    182
    yes tried both.

Posting Permissions

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