Viewing 3 posts - 151 through 153 (of 153 total)
IN sql 2005, you can also look up the PIVOT operator. In SQL 2000, you still had to use the CASE statement as follows:
Select
SalesPersonID,
JanSales = Sum(Case when month(SaleDate) = 1...
December 8, 2007 at 10:24 pm
#758354
There are a couple of ways to tackle this. Maybe the least coding is to do a dynamic sql string.
something like
Declare @sql varchar(4000)
Set @sql = 'Select...
December 8, 2007 at 6:49 pm
#758343
You can get the value from the inserted table.
December 7, 2007 at 6:16 pm
#758252