473,598 Members | 3,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
1 2062
Sorry,

I forgot to mention I'm talking about Access 97 ...
bo*******@hotma il.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6760
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
11
17543
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time to load making any kind linkage with my Access data virtually useless. I have the MySQL driver setup in as a USER DSN. The MySQL data is sitting out on a server and the Access database is running locally. The network connection is very...
8
4028
by: Alfonso Esteban Gonzalez Sencion | last post by:
I am trying to use Access as a front end for extracting information from an Oracle database. I started using linked tables but I am getting a very curious behaviour. When I consult the linked table in access, the total number of records is OK but some records appear several times and some records do not appear at all. It seems as if access or the ODBC drivers returns several times the same record and skips some of the records, curiosly...
7
11822
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For tables that involve a number field as the primary key, the data is returned successfully. For tables that involve a character field (e.g. CHAR(3) or VARCHAR(10)) as the primary key, I have the correct number of rows returned, but the data displayed...
11
2710
by: Randy Harris | last post by:
I have been using "IN" to query tables in Oracle from MS Access very successfully. Select Field FROM MyTable IN [ODBC...etc Works great if there is only one table involved. Anyone know how I can use the same technique with multiple tables (and be certain that the join occurs at the server). --
4
2712
by: Phil Latio | last post by:
Scenario is: We have an intranet on which a Helpdesk application can be accessed. Data input into the Helpdesk is stored in a Access 2000 database, held on a server. This is great, works fine, Users and IT have a warm fuzzy feeling of contentment. Turns out Helpdesk application is short of decent reporting capabilities. So, I create an Access DB on my machine, via ODBC, link to the tables within the Helpdesk Access database. I set the...
3
4350
by: Mike | last post by:
I have transferred the data from Access to MySQL using MySQL's tool. The transfer worked great and saved me a lot of time (thanks MySQL). Now I'm trying to get the Access database, or a new access database, to talk across ODBC and see the data. I created the DSN through the control panel and it works without error. How do I setup Access so it can see the data. The data
2
6624
by: teddysnips | last post by:
One of our clients has reported a problem. Everything was working fine on Monday, but since Tuesday all is going wrong. The sysadmin assures me that there have been no changes to the network, or the servers. Three applications, one back-end database server (SQL Server 2000 with all service packs etc.). APP 1: Access 2000 database APP 2: ASP.NET (VS 2003)
3
5121
by: Bret Kuhns | last post by:
I recently started a co-op/internship at a company and they are looking to migrate a large legacy supported application from OLEDB to SQL Server. I'm doing prelim work in experimenting with the options available. The application is huge (1+ million lines of C++ code), so it'd be quite a bit of man hours to adapt all the database code for SQL Server. I stumbled upon linked tables in an OLEDB file to an ODBC source (such as SQL Server) and...
0
7987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8392
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8264
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.