| Date: | Mon, 15 Dec 2003 09:23:02 +1100 |
| Reply-To: | Frank Milthorpe <Frank.Milthorpe@dipnr.nsw.gov.au> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | Frank Milthorpe <Frank.Milthorpe@dipnr.nsw.gov.au> |
| Subject: | SQL SELECT for Excel: Was new query problem |
|
| Content-Type: | text/plain; charset=US-ASCII |
It is possible to modify the automatic syntax generated by the
ODBC GET DATA wizard. This is quite simple if you want all
variables from an Excel sheet. See the following example
adapted from the original posting by Muir Houston.
GET DATA /TYPE=ODBC /CONNECT=
'DSN=Excel Files;DBQ=C:\Access and Retention\January_02\Phase_2\2003
'
'Students.xls;DriverId=790;MaxBufferSize=2048;PageTimeout=5;'
/SQL =
'SELECT * FROM `Sheet$` '.
Essentially I have I taken the top part of the automatically
generated syntax and extensively modified the SELECT part. The
SELECT is saying take all variables (the * part) from worksheet
name Sheet.
I believe that this results in syntax that is much easier to
read.
Regards
Frank Milthorpe
PS
On my computer the Excel ODBC driver is DriverID=22. I am not
sure what causes this to vary.
--------------------------------------------
Frank Milthorpe
Transport Modelling Manager
Transport and Population Data Centre (TPDC)
Department of Infrastructure, Planning and Natural Resources
GPO Box 3927, Sydney NSW 2001
Level 5, 20 Lee Street, Sydney
Direct: +61 2 9762 8488
Tel: +61 2 9762 8511
Fax: +61 2 9762 8514
Email: frank.milthorpe@dipnr.nsw.gov.au
|