I have a table like:
MonthOpened #ofDefectOpened MonthClosed #ofDefectClosed Oustanding
Jan 2013 50 Jan 2013 30
Feb 2013 20 Feb 2013 30
Mar 2013 60 Feb 2013 20
I need to calculate the outstanding and create the view.
Calculation for outstanding: For Jan 2013 Outstanding=#ofDefectOpened - #ofDefectClosed=50-30=20
For Feb 2013 Outstanding=Jan 2013 Outstanding+Feb 2013 #ofDefectOpened- Mar 2013#ofDefectClosed =20+20-30=10
For Mar 2013 Outstanding=Feb 2013 Outstanding+Mar 2013 #ofDefectOpened- Mar 2013#ofDefectClosed =10+60-20=50
Please let me know how to do this in Sql Sever 2008.
Thank you
MonthOpened #ofDefectOpened MonthClosed #ofDefectClosed Oustanding
Jan 2013 50 Jan 2013 30
Feb 2013 20 Feb 2013 30
Mar 2013 60 Feb 2013 20
I need to calculate the outstanding and create the view.
Calculation for outstanding: For Jan 2013 Outstanding=#ofDefectOpened - #ofDefectClosed=50-30=20
For Feb 2013 Outstanding=Jan 2013 Outstanding+Feb 2013 #ofDefectOpened- Mar 2013#ofDefectClosed =20+20-30=10
For Mar 2013 Outstanding=Feb 2013 Outstanding+Mar 2013 #ofDefectOpened- Mar 2013#ofDefectClosed =10+60-20=50
Please let me know how to do this in Sql Sever 2008.
Thank you