السلام عليكم ورحمة الله
ممكن يفيدك هذا الكود
PHP كود :
Dim connString As String = "Provider=....."
Dim sqlString As String = _
" SELECT SUM([m1]) AS [Total1] " & _
" , SUM([m2]) AS [Total2] " & _
" , SUM([m3]) AS [Total3] " & _
" FROM [الجدول]" & _
" WHERE [bda8] BETWEEN @date1 AND @date2 "
Using da As New OleDbDataAdapter(sqlString, connString)
da.SelectCommand.Parameters.AddWithValue("@date1", Me.DateTimePicker1.Value.Date)
da.SelectCommand.Parameters.AddWithValue("@date2", Me.DateTimePicker2.Value.Date)
Using dt As New DataTable
If da.Fill(dt) > 0 Then
MsgBox(dt.Rows(0).Item("Total1"))
MsgBox(dt.Rows(0).Item("Total2"))
MsgBox(dt.Rows(0).Item("Total3"))
End If
End Using
End Using

