Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering Records
Message
 
 
À
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:
00550914
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 LIKE should work, but with SET ANSI OFF you can just use
lcJobNumber = "464646666664"   && Get specific job
lcJobNumber = "464"   && Get all jobs that start with "464"
lcJobNumber = ""   && Get all jobs
...
where JobNumber = lcJobNumber
>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.
>


< SNIP >
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform