Excel 2007 中的 SQL 查询,可以在 Access 2007 中使用吗?

Excel 2007 中的 SQL 查询,可以在 Access 2007 中使用吗?

我有一个用 MS Query 在 Excel 中编写的查询,但我想在 Access 中运行它。我收到“查询中的语法错误”,但不确定是什么。这是查询:

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'} )) 

相关内容