troubleshooting Question

sql script - sql server 2008

Avatar of B0b_shiska
B0b_shiska asked on
Microsoft SQL ServerSQL
6 Comments1 Solution235 ViewsLast Modified:
Hi. From the below, how can i calculate the total of col 1 + col2 + col4 and put results in new column named 'newcol5'?

Also, calculate the following: 12 mth average based on recent calendar quarter and put results as 'total12avg'? In this case it would be the average of all rows from column 'month' 2010-04 to 2011-03. Thanks.

Month       col 1      col2 2       col3 x      col4        'newcol 5'
2011-05      x                   x            x               x             x      
2011-04      x      
2011-03      x      
.......-....    x
.......-.....      x             x               x               x             x
2010-04   x             x               x               x             x

First quarter: from the beginning of January to the end of March                        
Second quarter: from the beginning of April to the end of June                        
Third quarter: from the beginning of July to the end of September                        
Fourth quarter: from the beginning of October to the end of December      
ASKER CERTIFIED SOLUTION
sachitjain

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros