The calendar control just learned how to query the data syntax between the two statements. I am eager to check the data syntax on the Internet and try it myself, but every time I do not have a syntax error, I cannot connect to the database. I feel that this method is in front of me.
The calendar control just learned how to query the data syntax between the two statements. I am eager to check the data syntax on the Internet and try it myself, but every time I do not have a syntax error, I cannot connect to the database. I feel that this method is in front of me.
The calendar control just learned how to query the data syntax between the two statements. I am eager to check the data syntax on the Internet and try it myself, however, every time I do not have a syntax error or cannot connect to the database, I feel that this method is in front of my eyes. I just can't get it out, so I am struggling. The following code queries the two calendar controls.
Private Sub commandateclick () date1 = DTPicker1.Value 'This is the calendar control date2 = DTPicker2.Value' that compares the sizes of two dates If DateDiff ("n", CDate (date1), CDate (date2 )) <0 Then MsgBox "the start date conflicts with the end date. Please reselect the date ",, "prompt" Exit Sub End If txtSQL = "select * from Recharge_Info where date> = '" & date1 & "' and date <= '" & date2 & "'" Set mrc = executeSQL (txtSQL, msgtext) If mrc. EOF = True Then MsgBox "No information" Exit Sub End If With MSFlexG Rid1 Do While mrc. EOF = False. CellAlignment = 4. Rows =. Rows + 1. TextMatrix (. Rows-2, 0) = mrc! Cardno. TextMatrix (. Rows-2, 1) = mrc! Addmoney. TextMatrix (. Rows-2, 2) = mrc! Date. TextMatrix (. Rows-2, 3) = mrc! Time. TextMatrix (. Rows-2, 4) = mrc! UserID. TextMatrix (. Rows-2, 5) = mrc! Status mrc. MoveNext If mrc. EOF = True Then. Rows =. Rows-1 End If Loop End With mrc. CloseEnd subI wrote a lot about it. The most useful thing is this sentence.
TxtSQL = "select * from Recharge_Info where date> = '" & date1 & "' and date <= '" & date2 &"'"
This method can be used not only to compare dates, but also to compare data with numbers!