× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Also, I think you meant to do an INSERT... not an Update...


Michael Schutte
Admin Professional
Bob Evans Farms, Inc.



midrange-l-bounces@xxxxxxxxxxxx wrote on 04/24/2008 10:11:43 AM:

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.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
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 thread ...

Replies:

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.