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 |
|
tariq2
Posting Yak Master
125 Posts |
Posted - 2011-10-26 : 09:15:33
|
| Hi,Thank you in advance for your assistance.MonthNum is tinyint and therefore the statement below yields'Msg 245, Level 16, State 1, Line 1Conversion failed when converting the varchar value 'Total' to data type tinyint.'select username,isNULL(monthnum,'Total'),reportname, sum(reportcount) from View_BIUsers_ReportData where TerritoryName = 'Germany'and Year = '2011' and TreeYear = '2011'group by username,monthnum,reportnamewith rollup |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-10-26 : 09:20:39
|
| select username,isNULL(convert(varchar(10),monthnum),'Total')==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
tariq2
Posting Yak Master
125 Posts |
Posted - 2011-10-26 : 09:39:35
|
| Worked a treat Nigel :) thank you |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-10-27 : 09:27:55
|
This should be done in your front end application unless you export data to text file MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|