Jump to content

Convert database value to integer ?


Yammaski

Recommended Posts

This works when the varPostcode is even or odd, but when I change (1235) to a value from my database (rsTest.Fields.Item("Postcode").Value), it doesn't work anymore. I tried it with CInt, but also no result. Postcode is as "text" in the db.

<%varPostcode=(1235)Call OddEvenNumber(varPostcode)Sub OddEvenNumber(iNumber)If iNumber MOD 2 = 0 ThenResponse.write ("EVEN")ElseResponse.write ("ODD")End IfEnd Sub%>

Link to comment
Share on other sites

  • 3 weeks later...

I'd try it. It works fine.

Dim NumValNumVal = Int([i]from database[/i])If Not isNumeric(NumVal) ThenResponse.Write "Not a set of number."ElseResponse.Write "A set of number is processed." ' This line is returned in my browser. Please check your script and database once again.End If

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...