用 select 编号字段,sum(Price字段) from tablename 

解决方案 »

  1.   

    select field1,field2,统计字段=field1+field2 from table
      

  2.   

    本人的程序如下:其中的所有数据均在RecordSet中。请赐教,,,
    For j = 0 To rstemp_prices.RecordCount - 1
       temp_lab_num = rstemp_prices("lab_num")
       msfdoctor.col = 1
       firstfind = 0
       For k = 0 To msfdoctor.Rows - 1
         msfdoctor.row = k
         If temp_lab_num = msfdoctor.text Then
            firstfind = 1
         Else
            If firstfind = 1 Then
              msfdoctor.row = k - 1
              msfdoctor.col = 7
              msfdoctor.CellBackColor = &HCDF1FA
              msfdoctor.text = "¥" & rstemp_prices("subprice")
              Exit For
           End If
          End If
           If k = msfdoctor.Rows - 1 Then
             msfdoctor.col = 7
             msfdoctor.CellBackColor = &HCDF1FA
             msfdoctor.text = "¥" & rstemp_prices("subprice")
           End If
       Next k
       rstemp_prices.MoveNext
    Next j