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

"Select Where In" returns more values than expected 1

Status
Not open for further replies.

mdav2

Programmer
Aug 22, 2000
363
GB
I have a simple table of client statuses starting at CS1 going upto CS60 odd. If I run the following statement it returns every entry beginning CS1 (CS1, CS11 to CS19).

Code:
SELECT clientstat, statusdesc ;
from clntstat ;
WHERE clientstat in ('CS1', 'CS14', 'CS40', 'CS41' ) ;
INTO CURSOR combosource

If I use a conventional WHERE OR statement naming all values then it works as expected returning 4 values.

Code:
SELECT clientstat, statusdesc ;
from clntstat ;
WHERE clientstat == 'CS1' OR clientstat == 'CS14' OR clientstat == 'CS40' OR clientstat == 'CS41' ;
INTO CURSOR combosource

I have tried using the SET EXACT ON but that makes no difference. I've tried ALLTRIMing the fields and that makes no difference either. I only need 4 items so I can use the WHERE OR here but I wondered if anyone knows the IN command of SQL works in this way.

I am using native VFP 8 SQL on VFP 8 tables.

Mark Davies
Warwickshire County Council
 
Hero !

Mark Davies
Warwickshire County Council
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top