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

Operator

Status
Not open for further replies.

nengie

Programmer
Jan 7, 2002
14
TH
Hi all,
I am VFP programmer and looking for operator in MS SQL 2000 that work like $ in foxpro.
For example :
In VFP, I can do like this....
select itemno, description from mytable where class $ "A B C"

but how can I do in MS SQL. TIA.
Thongchai
 
what does this "$" ?
the syntax looks alike the "IN (...)" condition
PFR
 
There is no direct equivalent of the VFP "$" (contained in)function in T-SQL. Below is an example of something that will give you simliar results.

SELECT itemno, description
FROM mytable
WHERE LEFT(class,1) IN ('A','B'C')

 
I left an error in the prior select. Here is the code which will work.

SELECT itemno, description
FROM mytable
WHERE LEFT(class,1) IN ('A','B','C')
 
Thanks all for responses.
I found another function that can apply this
SELECT itemno,description
FROM mytable
WHERE charindex(class, 'A B C') <> 0

remark : class is char(1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top