Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optional WHERE's
Message
De
22/05/1999 20:31:24
 
 
À
22/05/1999 05:53:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00221714
Message ID:
00221811
Vues:
14
Replace your "=" operators with "LIKE" operators in the WHERE clause.

If you want to retrieve data for just one value, set the variable(s) to that value (be careful, the string value should not be trimmed).

If you want all records, set the variable to "%".

Unfortunately, this works only for character fields.

Vlad

>I am creating a PV to create a report for a school app. The user specifies the parameters as follows:
>
>The user must specify the Term (?vTerm). The other parameters are optional: Student Name (?vStuFKey--one student only), Level (?vLevel--all classes for that level), Level + Section (?vSection--all activities for that level+section) OR Level + Section + Activity (?vActivity--one class only). I'm having trouble with the SQL WHERE clause. Let's take the simplest example: the user wants the report for the entire Term (all classes, all students). In that case I want all the other ?v-parameters ignored:
>
>1. Is there a wildcard character that I can use for the other ?v-parameters so that they will be ignored or be all-inclusive?
>
>2. If not, how can I write the SQL to scratch where I itch?
>
>TIA,
>John
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform