Cannot Use 'FormatNumber' in the Expression of a Label

Results 1 to 2 of 2

Thread: Cannot Use 'FormatNumber' in the Expression of a Label

  1. #1
    Jason Grazado Guest

    Default Cannot Use 'FormatNumber' in the Expression of a Label

    Hi All,<BR><BR>I hope I am posting correctly.<BR><BR>I have a database that returns numbers with several decimal places. I want to display the number in a label with two digit precision but it is not letting me use the expression &#039formatnumber([myvalue],2)&#039 I&#039m spent hours looking for a solution and can&#039t believe its this difficult. What am I missing? Please email me as well as I&#039m hunting for the answer elsewhere.<BR><BR>Jason (jason.grazado@pfizer.com)

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Cannot Use 'FormatNumber' in the Expression of a Label

    Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "DSN=Something"<BR><BR>Dim strSQL<BR>strSQL = "SELECT NumberField FROM Table1"<BR><BR>Dim objRS<BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR>objRS.Op en strSQL, objConn<BR><BR>Do WHile Not objRS.EOF<BR><BR> Response.Write FormatNumber(objRS("NumberField"),2) & "&#060;P>"<BR> objRS.MoveNext<BR><BR>Loop<BR><BR>That&#039s all there is to it!

Posting Permissions

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