Public Sub showbb ()
Dim As Integer I
Dim j As String
Dim k As String
Dim X As the Date
Dim time1 As String
Dim time2 As String
Dim time3 As String
Dim Y As String
Dim the Rs As New ADODB. You connect to the database ADO variables'
Time1=Format (datetime Value, "yyyy - MM - dd")
X=CDate (time1)
Y="'" + time1 + "'"
For I=0 To 23
If I & lt; 10 Then
J=CStr (I)
Time2="0" & amp; J & amp; ":" & amp; "00" & amp; ":" & amp; "00"
End the If
If I & gt; 10 Then=
J=CStr (I)
Time2=j & amp; ":" & amp; "00" & amp; ":" & amp; "00"
End the If
If I + 1 & lt; 10 Then
K=CStr (I + 1)
Time3="0" & amp; K & amp; ":" & amp; "00" & amp; ":" & amp; "00"
End the If
If I + 1 & gt; 10 Then=
K=CStr (I + 1)
Time3=k & amp; ":" & amp; "00" & amp; ":" & amp; "00"
End the If
Open IFIX_DATA openDB1 'database, the function is defined at the back
CmdTruck. ActiveConnection=conn
CmdTruck.Com mandText="select data. The PH, the data. The PAH, data. The turbidity from data where the convert (char (10), time, 120)='time1' and convert (char (8), time, 108) between 'time2' and 'time3'"
Set the Rs=CmdTruck. Execute
Writing less than the data query, when the time1, time2, time3 with accurate value, such as: time1 to 2020-02-28, time2 14:00:00, time3 15:00:00 can query to the data, please help and see what went wrong?