Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT SQL question
Message
From
26/03/2004 09:41:48
 
 
To
26/03/2004 09:33:38
Steven Kleypas
Tarrant County College District
Texas, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00889939
Message ID:
00889945
Views:
16
>What is the correct syntax to do something like the following?
>
>FUNCTION GetStudentCount
>LPARAMETERS tnCourseID
>RETURN SELECT COUNT(*) FROM v_students WHERE iCourseID = tnCourseID

If you're doing this with native VFP code, there's really no reason to use a SQL SELECT here:
COUNT TO nResult FOR iCourseID = tnCourseID
RETURN nResult
Do keep in mind that COUNT moves the record pointer, so you may want code to save and restore it.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform