Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strings to Integers

Status
Not open for further replies.

Phonez

Technical User
Jan 16, 2002
58
GB
I realise that this might be the most easiest thing to do but for some reason I cant get it to work.

All I am trying to do is convert the value in a session variable into an integer so I can conpare it with a record in a database.

The term 'can't see the woods for the trees' comes to mind
 
You should be able to use the CINT function
Cint(Session("blah"))
 
This is the code that i've got:
Code:
num = Cint(session("client_id"))
.
.
strquery =  "select * from system where client_no = '" & num & "'"
set query = objconn.execute(strquery)
.
.

The client_no in system is a number anyway but I still appear to be getting a data type mismatch
 
Take the single quotes off if you are passing a number... single quotes denote strings.

strquery = "select * from system where client_no=" & num
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top