Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Call failed 'cause of a Group By? 1

Status
Not open for further replies.

SebFr

Programmer
May 28, 2006
12
US
Hi,

I'm using Access 2003 and I'm having a query problem with a linked table in SQL Server 2005.

Here is my query 1:
SELECT "Answering Service" AS Name, Count([CSR00 - IP Addresses].GrandTotal) AS Orders, Sum([CSR00 - IP Addresses].GrandTotal) AS [Total Sales]
FROM [CSR00 - IP Addresses]
GROUP BY "Answering Service";

[CSR00 - IP Addresses] is another query which refers to a linked table in SQL Server 2005, and when I execute this query I have no problem.

But then when I try to execute the query 1, I have an error message "ODBC -- Call Failed" and that's it.

Moreover, if I remove the GROUP BY, the query works...I don't understand what's wrong.

Can anybody help me ? Any help is appreciated !
Thanks
 
What is "Answering Service"? Field name, string constant?

If it is a Field Name:
Code:
SELECT [Answering Service] AS Name, 
       Count([CSR00 - IP Addresses].GrandTotal) AS Orders,    
       Sum([CSR00 - IP Addresses].GrandTotal) AS [Total Sales]
FROM [CSR00 - IP Addresses]
GROUP BY Name

If it is a constant:
Code:
SELECT 'Answering Service' AS Name, 
       Count([CSR00 - IP Addresses].GrandTotal) AS Orders,    
       Sum([CSR00 - IP Addresses].GrandTotal) AS [Total Sales]
FROM [CSR00 - IP Addresses]
GROUP BY Name



Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Thanks for your answer bborissov !

"Answering Service" is a string constant, and i've changed my request as you wrote it but I still have the same error...:(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top