WHERE IN Query with two recordsets in Access VBA

你离开我真会死。 提交于 2019-12-01 14:37:24

You can compare data from two different sources in one query. You can either use the IN keyword in SQL or, more simply, link to the Excel table (sheet) in Access and build your query around that.

EDIT an example using IN

SELECT * FROM  CompareTable 
LEFT JOIN
   (SELECT * FROM [Sheet1$]  
    IN ''[Excel 8.0;HDR=YES;IMEX=2;DATABASE=C:\Full\Path\AndName.xls]) C
ON CompareTable.CourseKey=c.CourseKey
WHERE c.CourseKey Is Null

Sheet1$ can also be Named_Range.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!