Hi,
I'm using Access 2003 and I'm having a query problem (again) with a linked table in SQL Server 2005.
Query:
SELECT Left([Comments],2) AS CSR, Sum(Orders.FinalGrandTotal) AS GrandTotal
FROM Orders
GROUP BY Left([Comments],2);
'Orders' is a linked table in SQL Server 2005, and 'Comments' is a field name of the table Orders.
When I run this query, I've the error message "ODBC - Call Failed". I've read that SQL Server doesn't like to use GROUP BY with the datatype Memo, and 'Comments' is defined as a Memo.
I can't change its type directly in the database so I want to convert it in the query by using the function Cstr()
New Query:
SELECT Left(Cstr([Comments]),2) AS CSR, Sum(Orders.FinalGrandTotal) AS GrandTotal
FROM Orders
GROUP BY Left(Cstr([Comments]),2);
But when I run this new query, I've another error message "Data type mismatch in criteria expression".
Can anyone please help me ?
Thanks for your answer
Seb
I'm using Access 2003 and I'm having a query problem (again) with a linked table in SQL Server 2005.
Query:
SELECT Left([Comments],2) AS CSR, Sum(Orders.FinalGrandTotal) AS GrandTotal
FROM Orders
GROUP BY Left([Comments],2);
'Orders' is a linked table in SQL Server 2005, and 'Comments' is a field name of the table Orders.
When I run this query, I've the error message "ODBC - Call Failed". I've read that SQL Server doesn't like to use GROUP BY with the datatype Memo, and 'Comments' is defined as a Memo.
I can't change its type directly in the database so I want to convert it in the query by using the function Cstr()
New Query:
SELECT Left(Cstr([Comments]),2) AS CSR, Sum(Orders.FinalGrandTotal) AS GrandTotal
FROM Orders
GROUP BY Left(Cstr([Comments]),2);
But when I run this new query, I've another error message "Data type mismatch in criteria expression".
Can anyone please help me ?
Thanks for your answer
Seb