Formatting a Fixed With Query Column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jtgarrison
    New Member
    • Jan 2010
    • 18

    Formatting a Fixed With Query Column

    I have a field in SQL that contains a Currency amount, which will be used for an export. It needs to be 13 characters long, preceded by 0 then the dollar amount, without the decimal point.

    The field name is DOCAMT. To get the full amount, I'm sure that I need to multiply the currency by 100, but how do I get the dynamic part of the field to be 0's.

    Since this will be an export, it would need to be a query instead of vba.

    Example:

    DOCTAMT= 205.47
    Multiplied by 100 gives me 20547, which is correct.
    But how do I get 8 0's in front of it, ie. 0000000020547.

    The next DOCAMT might be 1234.56 and would need to be 0000000123456

    Any ideas?

    Thanks

    Jeff
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    You could do this
    Format (Cint(DOCAMT*10 0),"00000000000 00")

    Jim

    Comment

    Working...