Re: Why does Access and Excel use different SQL formats?
- From: "Ed Adamthwaite" <adamedSpamMe@xxxxxxxxxxxxxxxx>
- Date: Thu, 1 Feb 2007 16:57:25 +1100
I have recently done a job for a company that needed to use Microsoft Query
within Excel.
MsQuery must be another app that Microsoft bought in holis bolis. Or it
could be that the Excel team never speaks to the Access team. "The left hand
doesn't know what the right hand is doing."
Hence the differences with SQL in Access. I thought it would be a quick job
but no! Ms strikes again! Just call me "Under-Quote-ED"
It varies depending on the datasource. Access, Excel, SQL Server etc.
Some differences I discovered:
MsQuery doesn't seem to like hard returns within the different clauses of
the SQL string or double-quotes as string delimiters, they must be
single-quotes.
If you are querying a single table, the FROM clause repeats the table name.
"FROM tblMyTable tblMyTable"
It beats my why Ms doesn't just use the Access QDE to in a different app
that can use different datesource interfaces. The Access QDE is a fairly
reliable and robust tool that is easy to use. It's dumb to re-invent the
wheel each time a new app is created.
I hope part of this helps, I just had to have a gripe about my experience
with Excel + Ms Query.
Regards,
Ed.
"Jim in Spokane" <JiminSpokane@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:66D570D6-CAE7-4AE0-A446-A94002FF928B@xxxxxxxxxxxxxxxx
Anyone know why Access uses a different format than Excel for SQL?
When I copy and paste one SQL Statement from Access to Excel I get an
error
and vice versa. Seems odd to me that Microsoft would use a different
format.
Access SQL View:
SELECT SYSADM_GJ.ID, SYSADM_GJ_DIST.AMOUNT, SYSADM_GJ_DIST.AMOUNT_TYPE,
SYSADM_GJ_DIST.BATCH_ID, SYSADM_GJ_DIST.POSTING_DATE
FROM SYSADM_GJ INNER JOIN SYSADM_GJ_DIST ON SYSADM_GJ.ID =
SYSADM_GJ_DIST.GJ_ID;
Excel SQL View:
SELECT GJ.ID, GJ_DIST.AMOUNT, GJ_DIST.AMOUNT_TYPE, GJ_DIST.BATCH_ID,
GJ_DIST.POSTING_DATE
FROM SYSADM.GJ GJ, SYSADM.GJ_DIST GJ_DIST
WHERE GJ_DIST.CURRENCY_ID = GJ.CURRENCY_ID
Thanks!
Jim
.
- Follow-Ups:
- Re: Why does Access and Excel use different SQL formats?
- From: blvda via AccessMonster.com
- Re: Why does Access and Excel use different SQL formats?
- Prev by Date: Re: Can you use source control with VBA?
- Next by Date: Re: For median, how to pick higher of two values, Access
- Previous by thread: Re: Problem copying a file with FileSystemObject.CopyFile
- Next by thread: Re: Why does Access and Excel use different SQL formats?
- Index(es):
Relevant Pages
|
|