Eu tenho uma consulta escrita com o Microsoft Query no Excel, mas gostaria de executar isso no Access. Estou recebendo um "erro de sintaxe na consulta" e não tenho certeza do que é. Esta é a consulta:
SELECT arcusfil_sql.cus_type_cd,
artypfil_sql.cus_type_desc,
oehdrhst_sql.orig_ord_type,
oehdrhst_sql.ord_type,
oehdrhst_sql.inv_no,
oehdrhst_sql.ord_no,
oehdrhst_sql.bill_to_name,
oehdrhst_sql.cus_no,
oelinhst_sql.item_no,
oelinhst_sql.item_desc_1,
oehdrhst_sql.inv_dt,
oelinhst_sql.qty_to_ship,
imitmidx_sql.commodity_cd,
imitmidx_sql.prod_cat,
oelinhst_sql.qty_return_to_stk,
imcatfil_sql.prod_cat_desc,
oelinhst_sql.unit_price,
oelinhst_sql.sls_amt,
cicmpy.accounttypecode,
cicmpy.sct_code,
cicmpy.salespersonnumber
FROM "001".dbo.arcusfil_sql arcusfil_sql,
"001".dbo.artypfil_sql artypfil_sql,
"001".dbo.cicmpy cicmpy,
"001".dbo.imcatfil_sql imcatfil_sql,
"001".dbo.imitmidx_sql imitmidx_sql,
"001".dbo.oehdrhst_sql oehdrhst_sql,
"001".dbo.oelinhst_sql oelinhst_sql
WHERE oelinhst_sql.ord_no = oehdrhst_sql.ord_no
AND oehdrhst_sql.cus_no = arcusfil_sql.cus_no
AND oehdrhst_sql.ord_type = oelinhst_sql.ord_type
AND oehdrhst_sql.inv_no = oelinhst_sql.inv_no
AND artypfil_sql.cus_type_cd = arcusfil_sql.cus_type_cd
AND imcatfil_sql.prod_cat = oelinhst_sql.prod_cat
AND imitmidx_sql.item_no = oelinhst_sql.item_no
AND cicmpy.debcode = oelinhst_sql.cus_no
AND (( oehdrhst_sql.ord_dt >= {ts '2013-01-01 00:00:00'} ))