This is strange. Why this is not working?? I have great difficulty in getting the data even thought I have searches which say to use this format :yyyy-mm-dd
Order_Date in tblSalesOrderHeader is normal DateTime . I insert it like this : Order_Date = DateTime.Today in the SQLITE Insert operation.
How to handle this Order_Date in the SQL statement?
Would apprecaite your help.
Use the same table SalesOrderHeader The problem : item(1) is working Item(2) is not working using DateRange to retrieve records Begin and End dates are converted in this string format : yyyy-mm-dd I use this to convert the DateTime: private string DateTimeSQLite(DateTime datetime) { string dateTimeFormat = "{0}-{1}-{2}"; return string.Format(dateTimeFormat, datetime.Year, datetime.Month, datetime.Day); } //-- 1 : Working var query = db.Query<SalesOrderHeader>("Select * From SalesOrderHeader Where DataEntryComplete ='" + "0'" + " AND Is_SyncToNAV ='0" + "'"); //--2 : not working var query = db.Query <SalesOrderHeader>("Select * From SalesOrderHeader WHERE Order_Date BETWEEN '" + Begin +"'" + " AND '" + End +"'" + " AND DataEntryComplete ='" + "0'" + " AND Is_SyncToNAV ='0" + "'");
YYYY-MM-DD
instead ofyyyy-mm-dd
, right? – M. MimpenDateTimeSQLLite
with a simpleToString
method:datetime.ToString("yyyy-MM-dd")
that results in2014-02-15
. Does the error persist? – M. Mimpen