General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>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
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