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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Casting and Comparing

Status
Not open for further replies.

PhatH

IS-IT--Management
Mar 30, 2004
88
US
I 2 datas in 2 different databse:

varchar strNumber = 1, 2, 3, ...
int numNumber = (let just say any number)

I coded:
if inStr(strNumber, numNumber) then " Checked"

Not working, I realized I'm comparing 2 different data, varchar and int. I tried to use inStr(strNumber, Cstr(numNumber)) but it doesn't work either.

can you tell what is missing??? thanks
 
Which part is not working?

Ie, I could se If InStr("1, 2, 3, 4","1") giving you the correct result but screwing up on If InStr("10, 11, 12","1"), is this the problem?

Anoher possibility is that because your dealing with numbers it might be confusing itself on which arguments your supplying, since it can take up to 4 arguments, two of which are numeric.

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
I'm sorry Tarwn,

I found out where the problem is, saving the data in string instead of integer, and tested it ok in our network.

Somehow when I uploaded and tested online... the problem seems to be undefeated... :)

I'm working on it and get back to you later. Thanks!!!
 
Nah, don't apologize for fixing it yourself :)

Or rather, you *mean mean person*, now that I don't have your problem to solve I have to get back to my real work again :p

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
[lol]

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top