Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized View Question
Message
From
07/12/1999 23:33:06
Victor Chigne
Inteliventas
Peru
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00300119
Message ID:
00300205
Views:
27
>When you setup a view in the designer and give it a parameter to use in the criteria, how do you get ALL records? For example, I have a view with a parameter ?lcCategory which the majority of the time is set to one of many possible categories in the database. However, sometimes the user wants to see ALL categories (hence all records). I can't just make it blank, because it looks for a blank category, but none exist (categories are chosen from a lookup table). At first I thought this should be easy, and it probably is, but I'm not getting it!!! Any help would be appreciated.

I guess you are using SQL Server as backend because a local view in VFP will return all rows for an empty parameter. To obtain all the rows in your view replace your condition from

field=?lcCategory

to

field LIKE ?lcCategory

and set lcCategory to "%" before opening your view

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform