|
yes Darren, it was the case.!
On Wed, Dec 9, 2015 at 9:24 AM, <darren@xxxxxxxxx> wrote:
Make sure you're paying attention to the case. For example, is it FRT or
frt? Also, you might want to wildcard the beginning. Here is a safe bet,
although it might be overkill:
select idord#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE upper
(idprt#) not
like '%FRT%' AND iddocd > 20150930
group by idord#
From: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 12/09/2015 09:20 AM
Subject: Re: This small query not compiling
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
I see but its not doing the select clause
its selecting all the parts.
we want to see the order amt without the freight. because the sales
commissions dont apply to freight rows. so can this still be done?
select idord#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE idprt# not
like 'frt%' AND iddocd > 20150930
group by idord#
On Wed, Dec 9, 2015 at 9:01 AM, Paul Nelson <nelsonp@xxxxxxxxxxxxx>
wrote:
Attending COMMON is also a good idea.have
Paul Nelson
Cell 708-670-6978
Office 409-267-4027
nelsonp@xxxxxxxxxxxxx
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
rob@xxxxxxxxx
Sent: Wednesday, December 09, 2015 7:22 AM
To: Midrange Systems Technical Discussion
Subject: Re: This small query not compiling
You're getting better; you've enclosed the offending message id. Great.
Now, if you read that message further you will see
DSPMSGD RANGE(SQL0122) MSGF(QSQLMSG)
1. Display message text
-- The statement contains column name &1 and an aggregate function in
the
SELECT clause and no GROUP BY clause is specified.
...
But it's the first one. You cannot put a column in a select when you
an aggregate function like SUM, without doing a control break on thatLike
selected column. In SQL a control break is done with GROUP BY.
Still gotta recommend reading a getting started with sql type book.
http://amazon.midrange.comlist
SQL/400 Developer's Guide (Vol 2)Sep 2000
by Mike Cravitz and Paul Conte
Old but a great start.
Selling for as low as $7.32
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 12/09/2015 07:55 AM
Subject: This small query not compiling
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
select idord#, sum(idshp# * idntu$) from astdta.oeind2 WHERE idprt# not
like 'frt%' AND iddocd > 20150930
am getting error,
SQL0122 - Column IDORD# or expression in SELECT list not valid. what is
wrong here in the syntax?
--
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.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
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.
--
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.
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.
--
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 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.