want to compare decimal fields

Results 1 to 2 of 2

Thread: want to compare decimal fields

  1. #1
    manoj Guest

    Default want to compare decimal fields

    sqlgroup = "select tests from testdecimal "<BR> set rsgroup = conn.execute(sqlgroup)<BR> points = rsgroup.fields(0)<BR>&#039tests field in db stores a value of 24.999<BR><BR> i = 26.435<BR> <BR> if i &#060; points then <BR> Response.Write rsgroup.fields(0)&"<BR>"<BR> else<BR> Response.Write ("not detected")<BR> end if <BR><BR>i have tried all things CSng(), CLng(), CDbl() applying on either sides of comparison , i get unexpected results<BR>i.e., firt time it shows proper results but when i change the<BR>less than (&#060;) to greater than(&#062;) it shows the same results<BR>which instead it should have gone to other part of if..end if<BR>can some one help me out..<BR><BR>thanx in advance<BR>manoj(manoj@huntindia.com)

  2. #2
    Join Date
    Dec 1969

    Default RE: want to compare decimal fields

    Have you tried to do a...<BR><BR>if CDbl(FormatNumber(points, 3)) &#060; CDbl(FormatNumber(i, 3)) then <BR>Response.Write points<BR><BR>else<BR>Response.Write ("Not Detected")<BR><BR>end if <BR><BR>HTH<BR><BR>Jerry

Posting Permissions

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