1.

Solve : Calculate multiple values (with the same jobNo) in an ADO recordset?

Answer»

Code: [Select]Dim div As Integer
      div = 0
      .MoveFirst
       Do Until .EOF
             mytotal = mytotal + (rs!b_total * rs!exchrate)
             div = div + 1
             .MoveNext
        Loop
           
        mytotal = mytotal / div
        Range("A15").Value = mytotal
This is what I use to add the product of 'b_total' and 'exchrate' in a recordset...  Just need to know how to get ADO to IDENTIFY and add up the rows with the SAME jobno. Thanks in advance! The SQL statement that FETCHED this record SET should be ABLE to do the calculations for you. Make sure you GROUP BY jobno and you use AVG of b_total multiplied by exchrate.

Good luck.



Discussion

No Comment Found