I'm trying to create a sales summary file using SQL, and I'm over my head.
I hope someone here can help.

I need to select all sales for a selected date and summarize it into
another file. I need to accumulate the sales amount, and create a count of
transactions by type. The fields from the detail file are:
Field Name - Description
PayDate - Date
Store - Store
Mfg - Manufacturer
PdType - Product Type
PmtType - Payment Type
AmtPaid - Amount paid

Each of these fields should be in the summary file, along with a field for
a count of transactions for each type, and AMTPAID should be the total of
payments for each transaction type.

I think the SQL should start with something like:
Update summaryfile when
(Select PayDate, Store, Mfg, PdType, PmtType, AmtPaid from detailfile
Where Paydate = 20080423
Group by PayDate, Store, Mfg, PdType, PmtType, AmtPaid
Order by Paydate, Store, Mfg, PdType, PmtType)

But how do I tell SQL to add a count of the transactions?

Thanks for your assistance,
Steve


Steven Morrison
Fidelity Express


Confidentiality Statement: This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please notify the sender immediately and delete it from your system.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.