Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 '%" & str & "%'

Author  Topic 

WC
Starting Member

2 Posts

Posted - 2002-08-05 : 03:10:03
When i code this User.UserID LIKE '%" & str & "%', how can i made it so that it can search by integer.
Because the code above only works for string data type but not for number data type.Can anyone please help?Thanks a lot.

Nazim
A custom title

1408 Posts

Posted - 2002-08-05 : 03:45:10
which software are you using?????????.




-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson
Go to Top of Page

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2002-08-05 : 05:44:15
where cast(user.userid as varchar(20)) like '%" & str & "%'

Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-08-05 : 08:40:35
if its sql server . & wouldnt work there you have to use + . you dont have to cast too. it does it implicitly.



-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson
Go to Top of Page
   

- Advertisement -