You won't find anyone here to write it for you. If you want help with problem areas then you can post your questions but you have to show proof of effort first. Please read this thread for suggestions on how to post meaningful questions.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...