SQL convert plus where

Viewed 59

I have this code

Dim datetofind As Date
datetofind = Calendar1.SelectedDate
AccessDataSource1.SelectCommand = "SELECT * FROM [Table1] WHERE ([Date] = '" & datetofind & "') "

The date field stores the value as dd/mm/yyyy 0.00.00 and there is no way to change it. How to apply the SQL convert function so that datetofind would be comparable to Date?

1 Answers

Use this syntax:

"SELECT * FROM [Table1] WHERE ([Date] = #" & datetofind & "#) "
Related