General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>I am using VB 6.0 SP2 and VFP ODBC driver 6.00.816700 (16/06/98) to access FoxPro 2.6 tables. The following query returns one record
>
>SELECT * FROM MainCase WHERE Office + CaseNo = "198-00001"
>
>The following query returns no records:
>
>SELECT * FROM MainCase WHERE Office + CaseNo = "198-0000"
>
>The only difference is the case number is truncated. This should return 9 records from the table. I thought maybe SET EXACT was ON, but when I added SET("Exact") as a column to the first SELECT statement it returned false.
>
>When I copy the second SELECT statement into the VFP Command Window it works just fine. Any ideas?
>
>Thanks!
Try...
SELECT * FROM MainCase WHERE Office + CaseNo Like "198-0000%"
or
SELECT * FROM MainCase WHERE left(Office + CaseNo,8) = "198-0000"
BOb
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only