Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gathering a set of records
Message
De
31/05/1999 21:35:18
 
 
À
31/05/1999 12:59:17
Randy Hooper
Ranco Business Software
Tampa, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00224673
Message ID:
00224784
Vues:
19
>>>I would like to have a sql to gather a set of records based on a date field. For example I have several records in my table, say for the month of May I want to only select May 5th thru May 12th. If someone could show me example I would be very appreciative...
>>>
>>>Thanks Randy
>>
>>
>>SELECT Field1, Field2, Field3 ;
>> FROM MyTable ;
>> WHERE BETWEEN(DateField, {05/05/98}, {05/12/98}) ;
>> INTO CURSOR MyCursor
>
>Craig
>Why do I get ambiguous date/datetime constant error message and for this rountine I do not want to use the time and etc.

It has to do with your STRICT DATE setting. You can rewrite this as:

SELECT Field1, Field2, Field3 ;
FROM MyTable ;
WHERE BETWEEN(DateField, {^1998/05/05, 00:00}, {^1998/05/12, 23:59:59}) ;
INTO CURSOR MyCursor
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform