Create one record from multiple records

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi everyone. Can someone please give me some pointers on how to
accomplish this task? I have one table with multiple records. Looks
kind of like this:

------------------------------------------------------------------------------------------------------------------
Cust_ID Name Charge Date
1000 XXXXXXXXXX 536.10 06/01/00
1352 XXXXXXXXXX 204.19 07/13/00
1000 XXXXXXXXXX 1055.42 08/15/00
1352 XXXXXXXXXX 978.11 09/14/00
------------------------------------------------------------------------------------------------------------------
What I need to do here is take all of the cust_id's that are the same
(the cust_ID field has multiple entries, just different charges and
dates), add the sum of the charges for a given year (for this example,
dates from 01/01/00 to 12/31/00) and insert the added total into a new
dbf file as one record. For the example above:

------------------------------------------------------------------------------------------------------------------
Cust_ID Name Total Charges Year
1000 XXXXXXXXXX 1591.52 00
1352 XXXXXXXXXX 1182.30 00
-----------------------------------------------------------------------------------------------------------------

Can someone tell me what would be the easiest way to get this done?
There are about 95,xxx records in this table.

Any help would be appreciated.

Arvin

.



Relevant Pages

  • Re: Create one record from multiple records
    ... accomplish this task? ... I have one table with multiple records. ... dates), add the sum of the charges for a given year (for this example, ... Bernhard Sander ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Create one record from multiple records
    ... a separate record for the records that have the name field blank. ... Bernhard Sander wrote: ... I have one table with multiple records. ... dates), add the sum of the charges for a given year (for this example, ...
    (microsoft.public.fox.programmer.exchange)
  • Inserting multiple records into two tables...with a twist
    ... ASP/SQL Server Express 05 ... insert into B. I have no problem doing this for individual records; ... I am not sure what the best way to this is for multiple records being ... How would you accomplish this if you were me? ...
    (comp.databases.ms-sqlserver)