I am using Xamarin Prism along with Sqlite-pcl-net Nuget .
While I write Query to obtain the elements of table between a range of dates as follows
public Task<List<JournalModel>> GetRecieptListAsync(DateTime startdate,DateTime enddate)
{
return database.QueryAsync<JournalModel>("SELECT * FROM [JournalModel] WHERE ( [PromisedDate] BETWEEN " + startdate + " AND " + enddate + ")");
}
StartD and EndD are variables of DateTime Datatype of Format:
StartD MM/dd/yyyy 00:00:00
EndD MM/dd/yyyy 23:59:59
After executing this Query I get a
SQLite.SQLiteException: near "12": syntax error
Which means at the hour of StartD. I hope You know it takes 12:00:00Am at StartD in the Database. Comment if I have to make more clearifications.