Reputation: 207
"SELECT Dateipfad FROM Attribute WHERE FS = '290' AND Letztes_mal_bearbeitet <= '15.11.2011 11:06:58'"
The datetimeValue is from a datetimepicker
Upvotes: 2
Views: 125
Reputation: 25262
Agree with LassV. Karlsen suggestion. http://msdn.microsoft.com/en-us/library/aa160564(v=office.11).aspx
Upvotes: 1
Reputation: 16711
To match a particular date type the date enclosed by hash marks. Try to use:
SELECT Dateipfad FROM Attribute WHERE FS = '290' AND Letztes_mal_bearbeitet <= #15/11/2011 11:06:58#;
Upvotes: 1
Reputation: 4129
add this while loading the form
datetimepicker.Format = DateTimePickerFormat.Custom;
datetimepicker.CustomFormat = "dd/MM/yyyy";
Upvotes: 1
Reputation: 66389
The correct way:
string strSQL = "SELECT Dateipfad FROM Attribute WHERE FS = '290' AND Letztes_mal_bearbeitet <= @date"
OleDbCommand command = new OleDbCommand(strSQL, oConnection);
command.Parameters.AddWithValue("@date", myDateTimePicker.Value);
//execute same way like you did before...
Upvotes: 3
Reputation: 8508
Change the . (dot) in the values with slash /
SELECT Dateipfad FROM Attribute WHERE FS = '290' AND Letztes_mal_bearbeitet <= '15/11/2011 11:06:58'
Upvotes: 1