Selecting records between two dates
Hello,
I'me trying to select the records that are on the database with the field 'Data" between two dates that are inserted into two fields: "DeData" and "aData". I've the following code but I'm getting an error on my SQL statment:
Private Sub DeData_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeData.ValueChanged
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=""C:\Programa?ao\Visual Basic\Inapal\ReportIt\ReportIt.mdb"";"
con.Open()
sSQL = "SELECT * FROM [RelatorioQuery] WHERE ((Data >'#" & DeData.Text & "#') AND (Data <'#" & aData.Text & "#')) AND (Descri?ao LIKE'%" & SearchBox.Text & "%')"
da = New OleDb.OleDbDataAdapter(sSQL, con)
ds.Clear()
da.Fill(ds, "RelatorioQuery")
DataGridView1.DataSource = ds
DataGridView1.DataMember = "RelatorioQuery"
con.Close()
End Sub
Can annyone help me please?
Thanks,
Jo?o Pinto

