Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you compare dates
Message
 
À
04/03/2010 08:19:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01452456
Message ID:
01452466
Vues:
66
Ken,

Your example syntax is confusing where you are using the word TABLE in the FROM clause. Is this the way you actually have your code written? Because that word needs to be the name of a table not the word TABLE as in;
SELECT * FROM Client WHERE client.DateApp=sdate INTO TABLE apprreport
Which will get you all the records that match the value of sdate in the field DateApp. BTW, I would suggest that use select into a cursor instead of a table as the cursor will be cleaned up by VFP automatically when you close it where as the TABLE will hang around taking up disk space until you manually delete it.

To get your data range you would use;
SELECT * FROM Client WHERE client.DateApp >= sdate AND client.DateApp <= edate INTO CURSOR apprreport
You do not need to USE the table for your select explicitly, the SELECT command will open the table for you.

Your result checking should use the _TALLY system variable when you use cursors as your target as it is more accurate for determining the number of records returned than using RECCOUNT().
SELECT * FROM Client WHERE client.DateApp >= sdate AND client.DateApp <= edate INTO CURSOR apprreport
IF _TALLY=0
   MessageBox("no records to display")
ELSE 
   MessageBox("ken>all")
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform