I am running a query just a simple Select Statement, how can I append (from within the query) a value to my int column? I have tried the below, but keep getting this error: Msg 245, Level 16, State 1, Line 1 Syntax error converting the varchar value 'Month ' to a column of data type int.
SELECT a.Sales, SUM(a.Count) As Count, CONVERT(INT, 'Month ') + dt.CumulativeMonth
FROM Rep a
INNER JOIN Date dt
ON a.Date = dt.FD
GROUP BY dt.CumulativeMonth, a.Sales
CONVERT(VARCHAR(2), dt.CumulativeMonth). Not sure why you are trying to convert'Month 'to an integer. How does that work exactly?