Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    1

    Unanswered: Right(Sum(Iif - LOSING DECIMAL

    Right$(1000000000+(Sum(IIf([Taa - WageTest]![Wages]>1000000000,999998.9,[Taa - WageTest]![Wages]))),9)

    I'm trying to add leading zeros to this field in a query. I'm assuming that the "RIGHT$" function is converting from a double to a string and any double (e.g. 125.00) will be read as 125 with no decimal.

    Is there any way to format this as a double while padding the left side of the the field with zeros?

    My original data type is a double that needs to be summed and then leading zeros added to keep the output the same length.

    I don't know if I'm asking the right questions here...let me know if it needs more clarification.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    No. the only way to have the leading zeros is to convert to a string. The easiest thing to do here is to have a format mask that displays as to wish ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    It looks like you are trying to do everything in one query. You will have to sum in one query, then use the results of the query in a second query. In the second query convert to a string with the Format function and then convert the string to a fixed length. Once you have a sum in the SumOfSomething field you can format the string like this:

    FormattedString:Right("0000000000",Format([SumOfSomething],"0.00"),10)

Posting Permissions

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