I have a table that looks like this:
Site | Category | Cost | Month |
A | Hardware | 10 | 1 |
A | Software | 30 | 1 |
B | Software | 15 | 1 |
C | Labor | 5 | 2 |
...
I need to output this:
Site | Category | 1 | 2 | ...
A | Hardware | 10 | 0 |
A | Software | 30 | 0 |
B | Software | 15 | 0 |
C | Labor | 0 | 5 |
What would be the best way to use the records under the Month attribute as column headers and allocate the Cost records under their corresponding Month columns?
Will give a line by line. You can add a
GROUP BY
if you want one line perCategory
Will keep Site, but sum up Category.
Also, if you don't like the Mx name for the field, you can try as '1' .. '2' etc.I think it should work