السلام عليكم ورحمة الله وبركاتة
إخوانى الاعزاء ياريت تشوفوا الكود ده وتقوليلى ايه الغلط فيه لانى لما بنفذ الكود من غير جملة where الكود بيشتغل ويختار كل السجلات لكن لما بعمل جملة where بيرجع كل السجلات برضه والمفروض انه يرجع بس عدد السجلات الموجوده بين التاريخين اللى انا مختار بيهم
If Text1.Text = "" Or Combo1.Text = "" Then
MsgBox ("Please select the service name and Insert the cost per minute to calculate"), vbInformation, "Statistic"
Text1.SetFocus
Else
On Error GoTo ErrorPara
Dim cn As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim cmd1 As New ADODB.Command
cn.CursorLocation = adUseClient
Dim s As String
Dim d As String
Label2.Caption = s
cn.Open s
cmd1.CommandType = adCmdText
cmd1.CommandText = "Select sum(actual_durations) as cnt,count(ani) as cnt1 from trans where call_date between '" & DateValue(Text8.Text) & "' And '" & DateValue(Text9.Text) & "'"
Set cmd1.ActiveConnection = cn
rs1.Open cmd1, , adOpenKeyset, adLockOptimistic
Text2.Text = (rs1!cnt / 60) * Trim(Text1.Text) & " K.D"
Text3.Text = rs1!cnt1
Text4.Text = rs1!cnt / 60
Text5.Text = rs1!cnt
rs1.MoveNext
rs1.Close
cn.Close
ErrorPara:
OpenConnections = False
UpdateLog "Error Opening Connections -- " & Now() & ", " & _
Err.Number & ", " & Err.Description
End If