truncating to 2 decimals

Results 1 to 2 of 2

Thread: truncating to 2 decimals

  1. #1
    Join Date
    Dec 1969

    Default truncating to 2 decimals

    Hi <BR>I am querying data from sqlserver 2000. i want to display output with 2 decimal points .Doing like this <BR>ex: select round(sales,2) from x <BR><BR>sales="12345.67789" <BR><BR>here i am getting 123456.68000 but i need to dispaly 123456.68 only.Sales data is not fixed length so i cant use left or right function.How to get with 2 decimal points? <BR>

  2. #2
    Join Date
    Dec 1969

    Default I would simply do it at the...

    ...output stage (i.e. in VBScript or JScript) rather than in the SQL statement, e.g.:<BR><BR>Response.Write FormatNumber(nMyNumber, 2) & "&#060;/br&#062;"<BR><BR>Oliver.

Posting Permissions

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