Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to SUM alike records with a SELECT statem
Message
From
13/10/2000 16:26:47
 
 
To
13/10/2000 13:06:57
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00429156
Message ID:
00429363
Views:
14
>>>Assuming that you want to sum a field such as Quantity, you could use something like this.
>>>
>>>
>>>SELECT MyTable.Part_Number, sum(MyTable.Qty) as Qty ;
>>> FROM MyTable ;
>>> GROUP BY MyTable.Part_Number ;
>>> ORDER BY MyTable.Part_Number
>>>
>>>The Group by will create one record for each part number.
>>>
>>>>In vfp60, Is there a way to SUM alike records with a SELECT statement?
>>>>I have a table with a field called part_number. This table is ORDER BY part_number...There are many records that contain the same
>>>>part_number values and I want to SUM these records so I have
>>>>a DISTINCT on part_number and the part_number values will be totaled and represented in one record for each part_number...any ideas?
>>----------------
>>Hi Norm...looks good, but my part_number is a non-numeric field...
>
>The part number does not need to be numeric. It is only the field that you are grouping the totals by. When you say that you are wanting to sum like records, aren't you trying to sum a numeric field with the total by the part_number?
---------
Norm, yes - you are right..........thanks.....:)
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Reply
Map
View

Click here to load this message in the networking platform