Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combibing fields that are alike
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00050118
Message ID:
00050164
Vues:
20
>>Can i group fields that are alike. I have a huge database of vendors from accross the U.S, who show up on my datbase as various entiries for reporting purposes i would like to see them in single purchase . For example have ten Best Buys ( TV & Appliance Store ) who have each a unique location. I don't care where it is located i just want one number for all items related to this vendor.
>>
>>Thanks in Advance
>>
>>Serg
>
>Select * From table1 Group by VendorName && use real table/field names

In addition, Serg, if you need to see a TOTAL for the group you can add a Count() field:

Select *, sum(mysale) as TOTSALE From table1 Group by VendorName

As Edward reminded you, use your own table & field names. This will give you the total of the MySale field for each group, and the 'new' field will be called TOTSALE. If you want to know how many are in the group, use Count():

Select *, sum(mysale) as TOTSALE, count(*) as NumVendor From table1 Group by VendorName

This will give you the total sale amount and the number of vendors in the group.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform