Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter question
Message
From
21/06/2000 13:42:32
Gerald McKinsey
Keystone Consulting Services, Inc.
Yorktown, Indiana, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Filter question
Miscellaneous
Thread ID:
00382816
Message ID:
00382816
Views:
56
I have a view with Customer & CustomerProducts tables inside it. This view has this filter:
CustomerProduct.iProductID = ?vp_iProductID

which obviously will give me a list of all customers that own a certain Product. However, once in a while, I'd like to just show all Customers. Do I HAVE to make a new view? If the filter was based on a STRING instead of an Integer, then I could use a LIKE, and send in "%" whenever I wanted everything. But I can't use "%" here.

Any ideas?
The only dumb idea I could come up with was making two filter lines:
CustomerProduct.iProductID >= ?vp_iProductLowID AND
CustomerProduct.iProductID <= ?vp_iProductHighID


So if I want to show all customers with ProductID #3, just:
vp_iProductLowID = 3
vp_iProductHighID = 3

And if I wanted to show ALL customers:
vp_iProductLowID = 0
vp_iProductHighID = 999999999

(Now you know why I'm asking for a better solution :)
Dustin
Next
Reply
Map
View

Click here to load this message in the networking platform