Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you compare dates
Message
 
To
04/03/2010 08:19:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01452456
Message ID:
01452466
Views:
65
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform