Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views parameterized on a date field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00496115
Message ID:
00496144
Vues:
11
This message has been marked as the solution to the initial question of the thread.
>>>I have a view with a single parameter based upon a date field. My problem is that I would sometimes like to pass a parameter that returns all records. I have tried passing an empty date, but that returns only records which contain and empty date field.
>>>
>>>When I have views with a single parameter based upon a character field, I am able to pass an empty string and all records are returned. How do get the same result when I am dealing with a date parameter?
>>>
>>>Thanks in advance
>>
>>How about using Between(DateField, ?BgnDate, ?EndDate) function? When you want just 1 date, make both date parameters the same.
>
>Sorry Mark, I don't understand. If I use Between() it will return a logical value. Won't I get an operand mismatch if I put in a filter expression for a date field?

Where SomeDateField = ?dDateParm also returns logical which is what you are using now, correct? There is no difference in that than in using the BETWEEN() function. You are telling your query to return all records that have a date inclusively between 2 date values. The following are identical:

where SomeDateField >= ?dBgnDateParm and SomeDateField <= ?dEndDateParm

where between(SomeDateField, ?dBgnDateParm, ?dEndDateParm)

If you want only those records for a single Date value, you make dBgnDateField the same date as dEndDateParm.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform