I am using Xamarin.Forms and C#. I am trying to get the count of Products for each month in a year.
string[] months = new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
var montlyCount = new Dictionary<string, int>();
foreach (var month in months)
{
var count = App.Database.GetCount(month);
montlyCount.Add(month, count);
}
Database.cs:
public int GetCount(string month)
{
return database.ExecuteScalar<int>("SELECT COUNT(*) FROM Products WHERE MONTH(ProductEntryDate) = ?;", month);
}
However, there is no such function "MONTH" with SQLite PCL. How can I get the count where month = "January", for example?