J
j.t.w
Hi All,
I am trying to make a query that will display line comments for each
line item on an order.
The following SQL statement works if any of the line items has a
comment in the dbo_OELINCMT_SQL table. If there are no comments for any
of the line items on the order, no records appear.
This is what I have so far:
SELECT dbo_OEORDHDR_SQL.*, dbo_OEORDLIN_SQL.*, dbo_OELINCMT_SQL.cmt
FROM (dbo_OEORDLIN_SQL INNER JOIN dbo_OEORDHDR_SQL ON
dbo_OEORDLIN_SQL.ord_no = dbo_OEORDHDR_SQL.ord_no) INNER JOIN
dbo_OELINCMT_SQL ON (dbo_OEORDLIN_SQL.line_seq_no =
dbo_OELINCMT_SQL.line_seq_no) AND (dbo_OEORDLIN_SQL.ord_no =
dbo_OELINCMT_SQL.ord_no)
WHERE (((dbo_OEORDHDR_SQL.ord_no)=[Order Number]));
dbo_OEORDHDR_SQL table (pretty standard):
ord_type pk
ord_no pk
cus_no
bill_to_name
inv_no
etc.
dbo_OEORDLIN_SQL table (pretty standard):
ord_type pk
ord_no pk
line_seq_no pk
item_no
item_desc
qty_to_ship
uom
etc.
dbo_OELINCMT_SQL table:
ord_type pk
ord_no pk
line_seq_no pk
lvl_no pk
cmt_type pk
cmt_seq_no pk
cmt
etc.
I am trying to retrieve a list of all line items, whether or not they
have a comment associated with a line item.
If someone could help me out with this, I would greatly appreciate it.
Thanks,
j.t.w
I am trying to make a query that will display line comments for each
line item on an order.
The following SQL statement works if any of the line items has a
comment in the dbo_OELINCMT_SQL table. If there are no comments for any
of the line items on the order, no records appear.
This is what I have so far:
SELECT dbo_OEORDHDR_SQL.*, dbo_OEORDLIN_SQL.*, dbo_OELINCMT_SQL.cmt
FROM (dbo_OEORDLIN_SQL INNER JOIN dbo_OEORDHDR_SQL ON
dbo_OEORDLIN_SQL.ord_no = dbo_OEORDHDR_SQL.ord_no) INNER JOIN
dbo_OELINCMT_SQL ON (dbo_OEORDLIN_SQL.line_seq_no =
dbo_OELINCMT_SQL.line_seq_no) AND (dbo_OEORDLIN_SQL.ord_no =
dbo_OELINCMT_SQL.ord_no)
WHERE (((dbo_OEORDHDR_SQL.ord_no)=[Order Number]));
dbo_OEORDHDR_SQL table (pretty standard):
ord_type pk
ord_no pk
cus_no
bill_to_name
inv_no
etc.
dbo_OEORDLIN_SQL table (pretty standard):
ord_type pk
ord_no pk
line_seq_no pk
item_no
item_desc
qty_to_ship
uom
etc.
dbo_OELINCMT_SQL table:
ord_type pk
ord_no pk
line_seq_no pk
lvl_no pk
cmt_type pk
cmt_seq_no pk
cmt
etc.
I am trying to retrieve a list of all line items, whether or not they
have a comment associated with a line item.
If someone could help me out with this, I would greatly appreciate it.
Thanks,
j.t.w