Round a currency value to 2 decimal places in a query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wirejp
    New Member
    • Jun 2014
    • 77

    #1

    Round a currency value to 2 decimal places in a query

    I am using Microsoft Access 2010 and I am trying to round a round a currency value to 2 decimal places in a query. The currency amount is still showing up as a whole number. Any help will be appreciated.

    Code:
    AdminFeeInitalZmC: CCur(Nz(Round(([InitialPrem]*[FeeInitialZm])*-0.015,0),2))
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    CCur will just convert to a currency DataType. You might want to use FormatCurrency( ) Function instead/also. Maybe even Format(SomeNumb er, "Currency") I believe, Format(SomeNumb er, "Currency") will use localization, meaning, for good or bad, it will use the currency format of the Local Computer.

    Usually, I don't worry about formatting while in a Query, I put the formatting on the Report or Form that displays the number to the user.

    Comment

    • wirejp
      New Member
      • Jun 2014
      • 77

      #3
      thank you, jforbes. You have solved the problem.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Originally posted by JForbes
        JForbes:
        Usually, I don't worry about formatting while in a Query, I put the formatting on the Report or Form that displays the number to the user.
        That is a critically important point!
        Trying to work with data that has alreeady been formatted is a nightmare that you would be well advised to avoid. Just because it looks similar doesn't mean that the data behaves in a remotely similar way.

        Work with the original data and display the formatted result. Never mix the two up if you want a comfortable life ;-)

        Comment

        Working...