Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LIKE() and LIKE operator
Message
From
21/10/2005 11:37:58
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01061096
Message ID:
01061107
Views:
17
Hi Naomi

I was talking about this on the tek-tips forums yesterday. LIKE() is not ANSI SQL. Use it in VFP where you need to, but in all SQLs use LIKE. Same goes for BETWEEN. In this case SQL LIKE does not accept question marks, but _. Personally, I find it really confusing to mix VFP and SQL syntax in a SQL command.

>Hi everybody,
>
>These two selects produce different results in VFP9:
>
>
>SELECT * FROM phones WHERE cArea_Code+cExchange+cLast_four like '???6948400'
>SELECT * FROM phones WHERE LIKE('???6948400',cArea_Code+cExchange+cLast_four)
>
>First doesn't return records. The second returns 2 records.
>-------------------
>It's because LIKE operator uses __ instead of ?.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform