|
FUND, DEPARTMENT, ACCOUNT, PROJECT, JOB are all a part of the accountthat
number. As I said in the previous email, this is a view that I created
joins the header, items, and accounts files together in one big query.http://friendfeed.com/mikewills
--
Mike Wills
Midrange Programmer/Analyst
Sick of corporate radio and hungry for something new?
http://thenextgenerationofradio.com
Stalking me? http://twitter.com/MikeWills |
file.
On Wed, Aug 6, 2008 at 10:13 AM, Lim Hock-Chai <
Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote:
Are you saying that you invoiceDetail file actually contained
Customer_Number, Customer_Name...? If it does, that is a strange
design. I would think those fields should be in invoice header
fileBut anyway, your email seems to indicate that your invoiceDetail
multiplecould contain multiple records for a invoice number and those
willrecords of a invoice number could contains different value on
CUSTOMER_NUMBER, CUSTOMER_NAME, INVOICE_DATE, INVOICE_AMOUNT, FUND,
DEPARTMENT, ACCOUNT, PROJECT, JOB fields. If that is the case, you
differentneed to tell SQL how you want to handle it when a invoice number is
found in two or more records and these two or more records has
number?CUSTOMER_NUMBER, CUSTOMER_NAME, INVOICE_DATE, INVOICE_AMOUNT, FUND,
DEPARTMENT, ACCOUNT, PROJECT, or JOB value.
For example, if your InvoiceDetail contains below:
INVOICE_NUMBER JOB
12345 XXXX
12345 YYYY
What JOB value do you want sql to show you for this one invoice
listed,
"Mike" <koldark@xxxxxxxxx> wrote in message
news:<mailman.1660.1217966486.2545.rpg400-l@xxxxxxxxxxxx>...
I am working on figuring out a fix for a bug that came up after Iadded a
feature the user requested. I don't want duplicate invoices
JOBbut they
now are. This is the problem SQL statement.
SELECT DISTINCT INVOICE_NUMBER, CUSTOMER_NUMBER, CUSTOMER_NAME,
INVOICE_DATE, INVOICE_AMOUNT, FUND, DEPARTMENT, ACCOUNT, PROJECT,
DEPARTMENT,FROM
INVOICEDETAIL ORDER BY FUND, DEPARTMENT, ACCOUNT, PROJECT, JOB
I know the problem and why the problem is there (the FUND,
queryACCOUNT, PROJECT, JOB is the account number for the item), but myquestion
is how can I fix it? I can't remove those fields from the selectbecause
then the ORDER BY doesn't work. Any ideas on how I can pull this
mailing listoff?
http://friendfeed.com/mikewills
--
Mike Wills
Midrange Programmer/Analyst
Sick of corporate radio and hungry for something new?
http://thenextgenerationofradio.com
Stalking me? http://twitter.com/MikeWills |
--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.