Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wild card in where clause
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00246921
Message ID:
00246927
Views:
20
You can use LIKE, instead of =. That will allow you to use % and _ as wild cards (like * and ? in DOS respectively). For example:
SELECT * ;
  FROM mytable ;
  WHERE MyField LIKE '%'
This will give you everything.

>Can you use a wildcard in the where clause of a select statement?
>
>
>
>if thisform.cToShow = "All"
>    lcCatToShow = ""        &&>>> This is where I want a wildcard
>   else
>    lcCatToShow = thisform.cToShow  && Or a specific one
>endif
>
>SELECT a.company, a.conname, a.ab_id ;
>	from AddressBook a;
>	inner join CatLink on a.ab_id == CatLink.ab_id ;
>
>	where obsolete = .f. ;
>	and CatLink.Catagory == lcCatToShow ;
>
>	ORDER by &lcDisplayOrder  ;
>	into cursor DisplayNames
>
>
>
>I tried the "" and got nothing.
>
>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform