March 3, 2012 at 2:03 am
Step 1 would be to use datetime column instead of separate columns for year and moth.
Then you'd be able to use PIVOT. Not just for PIVOT but as a better solution in general (unless there's a buch of constraints to make sure both columns are valid (e.g. Month only allows values from 1 to 12). The constraint would become slightly moredifficult if you'll need to check that there are no dates larger than today.
Regardless of the table design, my preferred method would be the CrossTab method as described in the related link in my signature.
March 3, 2012 at 3:36 am
Thanks a lot for your help and cross tab article was really helpful.
Viewing 2 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply