View Full Version : How do i show this in a Pass Through Query


papic1972
10-18-2010, 02:59 PM
Hi all,

Does anyone know how i would show this in a Pass Through Query?:

Sum(tblLocal.MinQty) AS SumOfMinQty,

I get the following error:

ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server] The sum or average aggregate operation cannot take nvarchar data type as an argument. (#409)
:eek:

pbaldy
10-18-2010, 03:03 PM
What is the data type of that field? It should be numeric. If you can't change it, you can try using the CAST function to convert it (or the CONVERT function, but I think CAST is more efficient in this case). More info in BOL on both.

papic1972
10-18-2010, 04:26 PM
Yes Paul! I used the CONVERT function & it works!
Thank you for triggering my brain!!

pbaldy
10-18-2010, 05:37 PM
Happy to help!