× 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.



thanks again, I forgot to look up the error code there, now in future i
will do so.

On Wed, Dec 9, 2015 at 11:15 AM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
wrote:

Good sir

Have you looked in the SQL Reference? That information for CREATE VIEW is
in the manual.

And the 2nd-level text will likely give you more information that likely
will lead you to the answer.

Although I could guess at the solution, I'd have to look it up myself, to
be sure it's right. Is it too much to ask people to do that work themselves?

Regards
Vern


On 12/9/2015 10:02 AM, Hoteltravelfundotcom wrote:

this is strange thing now.. OEINDLID is a PF.

this select works
select idord#, idprt#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE
idprt# not
like 'FRT%' AND iddocd > 20150930
group by idord#, idprt#

but when trying to create a view of this

CREATE VIEW ordamtno as
select idord#, idprt#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE
idprt# not
like 'FRT%' AND iddocd > 20150930
group by idord#, idprt#

i get error sql 0153 column list required.

what do i need to put here?


On Wed, Dec 9, 2015 at 9:36 AM, Hoteltravelfundotcom <
hoteltravelfun@xxxxxxxxx> wrote:

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.

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

have

an aggregate function like SUM, without doing a control break on that
selected column. In SQL a control break is done with GROUP BY.

Still gotta recommend reading a getting started with sql type book.

Like

http://amazon.midrange.com
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

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.


--
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.



--
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.