By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

ODBC problem with Access Queries to linked tables to SQL Server 2000

P: n/a
Help,

I have an Access database with link tables to a SQL Server 2000
database.

When I run the following query, it works OK:

SELECT Format([Issue_Date],"mmmm yyyy") AS DateTXT,
Sum([Current_State]='CANCELLED') AS Cancelled
FROM ECNDetails
GROUP BY Format([Issue_Date],"mmmm yyyy")
However, when I try to run this one, it fails:

SELECT Issue_Date AS DateTXT,
Sum([Current_State]='CANCELLED') AS Cancelled
FROM ECNDetails
GROUP BY Issue_Date

It gives me two messages:

"ODBC -- call Failed"
and
"[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect
syntax near '='. (#170)"
I have checked the DSN for the linked tables. I have re-created all the
linked tables. Both password and authorities are correct.

So, can anybody tell me why the first query would run but the second
wouldn't.

Any help is very much appreciated.

Thanks.

Aug 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry,

I forgot to mention I'm talking about Access 97 ...
bo*******@hotmail.com wrote:
Help,

I have an Access database with link tables to a SQL Server 2000
database.

When I run the following query, it works OK:

SELECT Format([Issue_Date],"mmmm yyyy") AS DateTXT,
Sum([Current_State]='CANCELLED') AS Cancelled
FROM ECNDetails
GROUP BY Format([Issue_Date],"mmmm yyyy")
However, when I try to run this one, it fails:

SELECT Issue_Date AS DateTXT,
Sum([Current_State]='CANCELLED') AS Cancelled
FROM ECNDetails
GROUP BY Issue_Date

It gives me two messages:

"ODBC -- call Failed"
and
"[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect
syntax near '='. (#170)"
I have checked the DSN for the linked tables. I have re-created all the
linked tables. Both password and authorities are correct.

So, can anybody tell me why the first query would run but the second
wouldn't.

Any help is very much appreciated.

Thanks.
Aug 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.