I am getting 'Syntax error in date in query expression 'Datum >= #1.4.2010.# and Datum <= #12.4.2010.'.
Datum is my date field in my database. I'm supposed to get all entries in the database where Datum (date) is between date selected on DateTimePicker1 and DateTimePicker2.
I have set date field format in access to Short Date, and also set Format property of datetimepickers to Short Date
Even tried using custom formats in both database and datetimepicker
I'm using MSAccess (Accdb) database
Query looks like this
"SELECT [Redni Broj], Vozilo, Prikolica, Vozač, [Kupac/dobavljač], Roba, [Mjesto isporuke], [Broj naloga], [Tara (kg)], [Netto (kg)], [Brutto (kg)], Datum, Vrijeme FROM Odvage WHERE Datum >= #" & Form1.DateTimePicker1.Value & "# and Datum <= #" & Form1.DateTimePicker2.Value & "# "
I can't get it to work!!!
Datum is my date field in my database. I'm supposed to get all entries in the database where Datum (date) is between date selected on DateTimePicker1 and DateTimePicker2.
I have set date field format in access to Short Date, and also set Format property of datetimepickers to Short Date
Even tried using custom formats in both database and datetimepicker
I'm using MSAccess (Accdb) database
Query looks like this
"SELECT [Redni Broj], Vozilo, Prikolica, Vozač, [Kupac/dobavljač], Roba, [Mjesto isporuke], [Broj naloga], [Tara (kg)], [Netto (kg)], [Brutto (kg)], Datum, Vrijeme FROM Odvage WHERE Datum >= #" & Form1.DateTimePicker1.Value & "# and Datum <= #" & Form1.DateTimePicker2.Value & "# "
I can't get it to work!!!