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 |
|
GeoTom
Starting Member
5 Posts |
Posted - 2011-07-14 : 18:39:15
|
| I've got no SQL background (a little matlab and VB) but my boss has got me running the client end of our database. I haven't got a clue how to do this. I've had a look at the other treads about this but i can't make it work. I would like to calulate a moving average of Cu_AA_pct based on 2 samples. The data is a number of different tables.CORPSAMPLEASSAYSAMPLEID NAME PRIORITY VAULE01W01 Cu_AA_pct 1 101W01 Fe3O4_SATMAGAN_pct 1 201W01 P2O5_ICP_pct 1 301W02 Cu_AA_pct 1 401W02 Fe3O4_SATMAGAN_pct 1 501W02 P2O5_ICP_pct 1 601W03 Cu_AA_pct 1 701W03 Fe3O4_SATMAGAN_pct 1 801W03 P2O5_ICP_pct 1 9the SAMPLETABLESAMPLEID HOLD_ID PROJECTCODE SAMPLEFROM SAMPLETO01W01 X1 UG 10 2001W01 X1 UG 20 3001W01 X1 UG 30 4001W02 X1 UG 40 5001W02 X1 UG 50 6001W02 Y1 UG 60 7001W03 Y1 UG 70 8001W03 Y1 UG 80 9001W03 Y1 UG 90 10001W04 C1 UG 100 11001W04 C1 UG 110 12001W04 C1 UG 120 13001W05 C1 UG 130 14001W05 C1 UG 140 15001W05 C1 UG 150 16001W06 C1 UG 160 17001W06 C1 UG 170 18001W06 C1 UG 180 190What i would likeSAMPLEID HOLD_ID SAMPLEFROM SAMPLETO Cu_AA_pct MOVEING AVERAGE01W01 X1 1 2 1 01W01 X1 2 3 2 1.501W01 X1 3 4 5 3.501W02 X1 4 5 6 5.501W02 Y1 1 1 12 01W02 Y1 2 2 24 1801W03 Y1 3 3 1 12.5any help would be amazzing i've been banging my head on this for most of the week. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|