Question : Update Query SQL 2008

Hi,
 
I have a table TRItems : Id, Date, Qty, Rate, Value

 Id      Date            Qty      Rate      Value      WTD_AVG_RATE      ProductId      

1      01/01/2010      5      25      125      ?                             273      
2      05/01/2010      2      25      50      ?                             273
3      02/02/2010      10      30      300      ?                             273

I WOULD LIKE TO UPDATE WTD_AVG_RATE IN THE SAME TABLE

 Id   WTD_AVG_RATE                                                      

1    SUM(VALUE) / SUM(QTY)  WHERE DATE <= DATE (01/01/2010) = 125/5 =25                  
2    SUM(VALUE) / SUM(QTY)  WHERE DATE <= DATE (05/01/2010)=175/7 = 25                  
3    SUM(VALUE) / SUM(QTY)  WHERE DATE <= DATE (02/02/2010)= 475/17=27.9411764            


Please note that it is Wtd. Avg & not Avg.

Thnx

Answer : Update Query SQL 2008

As per my knowledge Notepad++ is a free source code/text editor not a compiler. And its written in C++. One of its feature is tabbed editing. To display and edit text and programming language source code files, Notepad++ uses the Scintilla editor component.

Try Notepad C to compile, I havn't yet used the same

here is the list of Compilers
http://en.wikipedia.org/wiki/List_of_compilers#C.2FC.2B.2B_compilers

AtB
Random Solutions  
 
programming4us programming4us