Martyn Sherriff wrote:
Many thanks for your help. I can now read the Access files. I just assumed that
I would need extra quotes for the space in the directory name.
--------------------------------------------------------------------------------
I'll take this opportunity to redeem myself: you don't need to worry about
ending the SQL statement with a semicolon when using -#delimit ;-. The SQL
statement is enclosed in quotation marks just like the DSN connection statement
is, and so Stata will ignore its semicolon just as it does those in the DSN.
local dsn MS Access Database;DBQ=<filename>.accdb;DefaultDir=<directory>\;
#delimit ;
odbc load, exec("
SELECT G.* FROM Selections AS S
LEFT JOIN GeneralSummary AS G
ON S.clinic_id = G.clinic_id AND S.patient_id = G.patient_id;
") dsn("`dsn'") clear;
assert !mi(clinic_id);
#delimit cr
will work.
Joseph Coveney
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/