Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering Records
Message
De
30/08/2001 11:39:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/08/2001 11:25:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00550901
Message ID:
00550908
Vues:
12
>I am working with a company who has developed a rather large database program to keep track of costs related to construction jobs. Unfortunately the vast majority of the program was developed by an accountant. To make matters worse he developed it in Access97. I am trying to recreate some of the programs functionality using VFP.
>
>Since variables cannot be passed per-se in Access they created functions that store query criteria in a table and then retrieve them from within the query using a function called GetSystemDefaults(). When a user wants to retrieve all records they use a crieteria of "ALL".
>
>My question arrises from the way they allow users to filter records in a query. The program will allow users to run a report using criteria such as specific job numbers or the user can run the report on all jobs.
>
>It is my understanding that the easiest way to do this is to use the "like" operator and a wildcard "*" to specify all data or use a specific key number to narrow the results. The program creator somehow used a combination of grouping on the function that retrieves the query criteria and a cryptic combination of "AND" and "OR" operators to achieve the same results.
>
>Am I simply off-base in my understanding of the filtering process?
>
>Thank you for any enlightenment that could be offered
>
>
>Kris Hokanson
>"Never send an accountant to do a programmers job."

Kris,
If you mean one id or all case you can do like this :
lparameters tnId
select * from myTable ;
 where AccId between ;
    iif(tnId=0,0,tnId) and ;
    iif(tnId=0,0x7FFFFFFF,tnId)
If it's char type then expression would be like chr(32) and chr(254) etc.
Or you could do something like Multiselecting with a grid like in FoxyClasses MultiSelectGrid.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform