|
I'm trying to create a sales summary file using SQL, and I'm over myhead.
I hope someone here can help.of
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
transactions by type. The fields from the detail file are:for
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
a count of transactions for each type, and AMTPAID should be the total of
payments for each transaction type.system.
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
--list
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.