Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Call Failed because of a Group By ?

Author  Topic 

Seb_CO
Starting Member

1 Post

Posted - 2006-05-28 : 11:16:28
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

Seb

PSamsig
Constraint Violating Yak Guru

384 Posts

Posted - 2006-05-28 : 12:03:54
Hmm, maybe what about:
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]
or to type less and make it more readable
SELECT [Answering Service] AS Name, Count(GrandTotal) AS Orders, Sum(GrandTotal) AS [Total Sales]
FROM [CSR00 - IP Addresses]
GROUP BY [Answering Service]


-- This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-29 : 03:00:34
You dont need to use group by when you use constant value

SELECT "Answering Service" AS Name, Count([CSR00 - IP Addresses].GrandTotal) AS Orders, Sum([CSR00 - IP Addresses].GrandTotal) AS [Total Sales]
FROM [CSR00 - IP Addresses]


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -