Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting grouped records and placing in table

Status
Not open for further replies.

jelks

Technical User
Jul 11, 2001
10
0
0
US
Hello 'Fox'ies.

Simple question. I am fairly new to VFP6 and need to count certain criteria in a table and add those results to another table. Example below.
[tt]
Map: Issue Results I want
---- ----- Map: ABC: QRS: XYZ:
ma-111 ABC ------ ---- --- ---
ma-111 ABC ma-111 2 1 1
ma-111 XYZ ma-222 1 1 0
ma-111 QRS
ma-222 ABC
ma-222 QRS[/tt]

Hope this helps. If more explanation is needed, please let me know and I will clarify further.
J
 
Hi
You can use crosstab query.
If you use Query Wizard you will need to add a dummy field in your table, because the wizard need 3 fields to make a crosstab query. Put Map in Row, Issue in Column and DummyField in Data. In step 3, select count in Summary, maybe you can use None in Subtotals.
If you prefer manual. At Query Designer, select Map and Issue from your table, add 3rd field using "function and expression" with COUNT(yourtable.issue) and at Miscellaneous select crosstab. You can use menu Query - Query Destination to spesify your table destination.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top