63falcondude
Well-known Member
- Joined
- Jan 15, 2016
- Messages
- 3,572
Can someone help me sort out this SQL in Access? I was getting a Syntax Error before adding the parenthesis to the FROM part of the code and am now getting the error "JOIN expression not supported". I am assuming the error is coming from the FROM part of the code but will include the entire code below.
Code:
select
d3.descrlong as OrderType,
o.no_int as OrderNo,
op.prodid2 as Model,
op.serialno as Serial,
o.empliddispo,
to_char(o.logtime,'mm/dd/yyyy') as OrderCreationDate,
to_char(o.closetime,'mm/dd/yyyy') as OrderCloseDate,
to_char(o.invdat, 'mm/dd/yyyy') as InvoiceDate,
a.no_int as itemno,
a.nam as Name,
ao.price as Price,
ao.LISTPRICE as listprice,
d1.descrlong as Invoicetype,
d2.descrlong as subtype
FROM (((((((ordhead o
INNER JOIN ordpos op ON o.orders_ik = op.orders_ik)
INNER JOIN orderrole r ON o.orders_ik = r.orders_ik)
LEFT JOIN articleorder ao ON ao.orders_ik = o.orders_ik)
INNER JOIN article a ON ao.article_ik = a.article_ik)
INNER JOIN descriptions d1 ON d1.record_ik = ao.clearingclass)
INNER JOIN descriptions d2 ON d2.record_ik = ao.clearingtyp)
INNER JOIN descriptions d3 ON d3.record_ik = o.typ)
WHERE
o.typ not in (5707)
and o.stat = 5506
and o.closetime between to_date('01-01-2016','mm-dd-yyyy') and to_date('08-31-2016','mm-dd-yyyy')+1
and r.partnerrole = 50301
and ao.typ = 52702
and ao.delflg = 0
and d1.lang = 5102
and d2.lang = 5102
and d3.lang = 5102
;