I have SQL 2005 view that has lines of data that I need to merge into new columns.
Example: (see attached spreadsheet)
If AccountType is AA then place value in Period1
If AccountType is B1 then place value in Budget 1 - problem is that I want these in the same line for my reports.
On attached spreadsheet the top version is what I am trying to get. The bottom is what I currently have. Basically I am trying to add a new column called Budget1 thru 12 basically that places the value if AccountType is B1.
I currenlty have the following:
CASE WHEN a.ActivityType='B1' THEN Period1 Else 0 END as Budget1
but this gives me seperate line of data for Budget and Period