Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ravishwor
Starting Member
20 Posts |
Posted - 2008-04-16 : 01:48:24
|
| I have the following data in a Table. Note that this table holds Sales Qty till Today and also Forecast Qty for the next n Months (where n could be between 1 - 15 months)YYYYMM Stock_Code Whse_code Sales_Qty----------- ---------------- --------- ------------200710 009040 B 505200711 009040 B 370200712 009040 B 385200801 009040 B 335200802 009040 B 305200803 009040 B 250200804 009040 B 250200805 009040 B 250200806 009040 B 250200807 009040 B 250200808 009040 B 250200809 009040 B 250200810 009040 B 250200710 009040 M 549200711 009040 M 565200712 009040 M 535200801 009040 M 685200802 009040 M 305200803 009040 M 240200804 009040 M 240200805 009040 M 240200806 009040 M 240200807 009040 M 240200808 009040 M 240200809 009040 M 240200810 009040 M 240200811 009040 M 240200812 009040 M 240200901 009040 M 240200902 009040 M 240200903 009040 M 240200904 009040 M 240200905 009040 M 240200906 009040 M 240How can I create a Column (6MthQtyToDate) that is the Sum of the Qty of the Last6Mths. I need this Column for each Row of data. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-16 : 02:30:02
|
You mean like a 6-month running total? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
ravishwor
Starting Member
20 Posts |
Posted - 2008-04-16 : 02:39:05
|
| Yes. |
 |
|
|
|
|
|