Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wildcard searching in SQL 7.0
Message
From
08/12/2000 13:52:36
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00450892
Message ID:
00450902
Views:
25
Larry,

Thanks for the reply. Unfortunately, this would not allow users to look for 9 digit codes, but force them to access zip codes ONLY by 5 digit.

e.g. where left(zip,5) in ('220461973','220461934')

would yield all 22046, not just the two zip codes they were looking for.

I was hoping that in ('22046%','22030%') would work, but it does not. The "%" is treated as a literal.


>How about rewriting a tiny portion of it:
>
>left(zip,5) in ('22046','22048','22049','22030')
>
>This appears to work.
>
>>I've search the docs and can't find what I'm looking for. Perhaps someone here has a quick solution.
>>
>>I'm trying to access SQL Server 7.0 and am spoiled by VFP SQL syntax. How do I convert the following to something that works in SQL 7.0?
>>
>>
>>Select city,state,zip from table1 where zip in ('22046','22048','22049','22030')
>>
>>
>>Fox will return 9 digit zip codes, but SQL 7.0 returns only 5 digit zip codes.
>>
>>I know that
>>
>>
>> .. where zip like '22046%'
>>
>>
>>will work in SQL 7.0, but I'm looking for a solution where I don't have to rewrite the syntax I'm currently useing i.e. "IN ()"
>>
>>Anybody know SQL Server 7.0 and have a better solution?
Timothy D. Yeaney
MCSD, Charter Member
President, PAFOX (Potomac Area Fox User Group)
mailto:tim@eagleeyeinc.com
Vice President
Eagle Eye Publishers, Inc
Broaden Your Vision, Sharpen Your Focus
Previous
Reply
Map
View

Click here to load this message in the networking platform