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.
| Author |
Topic |
|
ross_gt
Starting Member
23 Posts |
Posted - 2011-05-27 : 18:40:33
|
| I keep getting this message:Operand data type nvarchar is invalid for sum operator.USE Customer_AnalyticsSELECT [Ordered By], [Order Date (YYYYMMDD)], SUM([Extended Sales PMAR Amount]) AS GT_RevenueFROM [Customer_Analytics].[CleanData].[0607080910_sorted]WHERE [Ordered By] LIKE N'%GEORGIA TECH%' AND [Order Date (YYYYMMDD)] >= '20100101' AND [Order Date (YYYYMMDD)] < '20110101'; |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2011-05-28 : 02:42:35
|
hi,your field [Extended Sales PMAR Amount] is nvarchar data type and you need to cast it before performing sum operation.e.g.:selectsum(cast([Extended Sales PMAR Amount] as int)) as GT_Revenuefrom[Customer_Analytics].[CleanData].[0607080910_sorted] |
 |
|
|
|
|
|