FORMAT Number

  • Hi. I have been playing around trying to out put a number in the desired format but no success (do not want currency symbol).

    The expression is as follows:

    ="Total 1: " & Sum(Fields!Value1.Value,"ds1") & VBcrlf & VBcrlf & "Total 2: " & Sum(Fields!Value2.Value,"ds1")/100

    This outputs:

    Total 1: 2940799.4800

    Total 2: 42203.6675

    I would like to format to read:

    Total 1: 2,940,799.48

    Total 2: 42,203.66 or even

    Total 1: 2,940,798

    Total 2: 42,204

    Can anyone assist?

    Thanks,

    Phil.

    -------------------------------------------------------------------------------------
    A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."

    Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '

    Tommy Cooper

  • Read Books On Line:

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/a87d0850-c670-4720-9ad5-6f5a22343ea8.htm where you will find the CONVERT function:

    The following table shows the values for style that can be used for converting money or smallmoney to character data.

    Value Output

    0 (default)

    No commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 4235.98.

    1

    Commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 3,510.92.

    2

    No commas every three digits to the left of the decimal point, and four digits to the right of the decimal point; for example, 4235.9819.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • You can also try using the format codes at: http://msdn.microsoft.com/en-us/library/ms157406(SQL.90).aspx

    These are gotten to by right clicking your textbox, going to properties and then 'format'. Input the appropriate code in the 'format code' box.

    You would also have to seperate the "totals" text into a seperate text box for this to work.....

  • Thanks for the links guys.

    Phil.

    -------------------------------------------------------------------------------------
    A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."

    Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '

    Tommy Cooper

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply