Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
calculate the average of a column then move it to excel
I have the following results after a sql query:
off_time mydata2 -------- -------- 12:15 4.324 12:30 5.26 12:45 6.9654 using this sql statement: select off_time, least(2+(0.044117*CT_OFF_GEN),8) as mydata2 from b_NRatio Using the above sql how can I average the the mydata2 column and store it in a variable? I then need to copy it to Excel like so: ADO_rs.Open ActiveCell.Offset(x, 5).Value = ADO_rs.Fields!AVGOFmydata2 David |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
calculate the average of a column then move it to excel
This isn't standard SQL, but the AVG function is, so a guess:
select AVG(least(2+(0.044117*CT_OFF_GEN),8)) as AVGOFmydata2 from b_NRatio -- "Aster99" wrote in message ... I have the following results after a sql query: off_time mydata2 -------- -------- 12:15 4.324 12:30 5.26 12:45 6.9654 using this sql statement: select off_time, least(2+(0.044117*CT_OFF_GEN),8) as mydata2 from b_NRatio Using the above sql how can I average the the mydata2 column and store it in a variable? I then need to copy it to Excel like so: ADO_rs.Open ActiveCell.Offset(x, 5).Value = ADO_rs.Fields!AVGOFmydata2 David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate weighted average for 1 column | Excel Worksheet Functions | |||
calculate average from non contiguous column, ignoring (0) values | Excel Worksheet Functions | |||
How can I use excel to calculate average annual ROI... | Excel Discussion (Misc queries) | |||
calculate average in a column based on criteria in another column | Excel Discussion (Misc queries) | |||
hOW TO USE EXCEL TO CALCULATE BASEBALL BATTING AVERAGE | Excel Worksheet Functions |