This is a known issue and it is related to the SQLite peculiarity, because dates are stored in the database as strings and comparison of dates is performed as string comparison. Strings may be different for the same date, because the date in SQLite may be stored with different accuracy (with milliseconds, etc.) and when comparing it with the date that we pass from .NET, strings for this date can differ(e.g., date of 13/06/2012 may have representation in .NET as 13.06.2012 00:00:00.0000000, and in SQLite it can be represented as 13/06/2012 00:00:00.00). However, we are considering adding the possibility to generate code with the conversion to the SQLite datetime type. We will inform you about the results as soon as possible.
For proper date comparison you could try using the explicit datetime type conversion and run queries via the
DataContext.ExecuteQuery() method, for example:
Code: Select all
YourDataContext ctx = new YourDataContext(){Log = Console.Out};
DateTime newDate = new DateTime(2013, 9, 16);
string query = "SELECT * FROM main.Students t1 WHERE date(t1.TuitionDate ) = date({0})";
IEnumerable<Student> rez = ctx.ExecuteQuery<Student>(query, newDate);
Also, a possible workaround could be find here:
http://forums.devart.com/viewtopic.php?t=24938