Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count command
Message
 
 
To
07/05/2003 06:59:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00785705
Message ID:
00786076
Views:
26
>Hi Guys,
>
>I am trying to count the number of distinct records in a field.
>
>If I try the following:
>
>select count(DISTINCT P_no) from DATATMP
>
>This gives me a query Dcnt_p_no with the correct result.
>
>I dont want to be presented with the results of the query and
>just want to store this count to a variable.
>
>Is there any easier way of doing this?

You can store the count to an array:

select count(DISTINCT P_no) from DATATMP ;
INTO ARRAY aResults

Then look at aResults[1].
- I don't know why Microsoft does not add the ability to send the result
to a variable!
- Andy Rice
San Diego, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform