This is probably an easy one, I am just having a brain fart. I have a column of dates covering several years. How can I make a query to break it up by year? For instance:
Code - Date - CustName - Sales
1001 - 2011-01-12 - Sparkies - 50
1002 - 2012-02-11 - Spankies - 125
1001 - 2013-01-12 - Sparkies - 60
1003 - 2011-05-05 - Squirrelies - 75
I would like a report to show:
Code - CustName - 2011 - 2012 - 2013
1001 - Sparkies - 50 - 0 - 60
1002 - Spankies - 0 - 125 - 0
1003 - Squirrelies - 75 - 0 - 0
This is in MSSQL 2008 R2. Thanks in advance...