Hey,
If the item number will be EXACTLY '/6' for all shipping charges, you'd
do this:
SELECT COMPANY, ORDERNUMH FROM ORDERHEAD
INNER JOIN ORDERDETL ON ORDERNUMD = ORDERNUMH
WHERE SHIPDATE = 20071101
AND ITMNUM <> '/6'
-Chris Anderson
Partners Mutual
Waukesha, WI
----------------------------------------------------------------------
message: 1
date: Fri, 2 Nov 2007 12:01:25 -0500
from: "Grizzly Malchow" <grizzlym@xxxxxxxxxxxxxxxxxxxxx>
subject: SQL Help
I'm trying to find out which shipments are missing a shipping charge.
Shipping charges appear on an order as a line item with the item number
= '/6'. I'm planning on using SQL, but I'm not quite sure about the
syntax.
I'm able to select shipments based on shipment date, but what I can't
figure out is how to check to see if one of the line items is the
shipping charge, or better yet only select those orders that do not have
a shipping charge.
Here's my syntax right now.
SELECT COMPANY, ORDERNUMH FROM ORDERHEAD
INNER JOIN ORDERDETL ON ORDERNUMD = ORDERNUMH
WHERE SHIPDATE = 20071101
This selects all orders and items for the specified ship date. I'd like
to trim that down to only select the orders that don't have an item
number = '/6'
Can anyone offer some suggestions?
Thanks in advance.
Griz
------------------------------
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) digest
list 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.
End of RPG400-L Digest, Vol 6, Issue 1091
*****************************************
As an Amazon Associate we earn from qualifying purchases.