Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter in View
Message
From
06/12/1998 04:49:31
 
 
To
06/12/1998 03:34:48
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00164430
Message ID:
00164514
Views:
18
>>>>>I want to set a Filter in View through Which I can either
>>>>>choose to :-
>>>>>
>>>>>1. Select all records
>>>>>or
>>>>>2. Select only deleted records
>>>>>or
>>>>>3. Select only undeleted Records
>>>>>
>>>>>Any suggestions/ideas ??
>>>>
>>>>either you add a field to your view
>>>>SELECT .. DELETED() as lDeleted
>>>>
>>>>or you can make this a parameter in your WHERE
>>>>and REQUERY as needed
>>>>
>>>>Arnon
>>>
>>>Thanks a Lot for both of your suggestions...
>>>
>>>I'll prefer to do it with WHERE Clause... But not able to form it properly...
>>>
>>>Can you pls tell me how to do exactly through where clause...
>>
>>You need to specify which tables records are to be considered for deletion status; in the examples below, substitute your table's alias for cAliasName in the DELETED() function. If only one table is considered in the query, you can omit it.
>>
>>Make certain to SET DELETED OFF before the query to allow consideration of deleted records in the query result (and to be able to see tuples that contain deleted records in the result!)
>>
>>For deleted records:
>>
>> WHERE DELETED(cAliasName)
>>
>>undeleted records:
>>
>> WHERE NOT DELETED(cAliasName)
>>
>>Do not include any reference to DELETED() if both deleted and undeleted records are to be considered.
>
>Thanks for your reply.. But do I have to create 3 views to get this result ???

You could select between the three states using a parameter and some nested IIF()s in the view view, doing something like this (the parameter in this example is a number, for this example -1 asks for DELETED(), 1 for ! DELETED(), and 0 for all:
WHERE IIF(?DEL_PARM = -1, DELETED(cAliasName), IIF(?DEL_PARM = 1, ! DELETED(cAliasName), .T.))
but this would not be Rushmore optimizable. I also don't know if you could construct this using the View Designer. And I have no idea if the view would be updatable, either; you'd certainly have problems with membership if you toggled the deletion status in the view.

I'd be more inclined to construct a query on the fly, with the WHERE clause built to include or not include a filter on the deletion status.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform