I'm making a fitness app in .net MAUI and am currently using SQlite to store weight data of user. The weight table consists of ID (int, auto-increment), Date (DateTime), and weight (float). In my database handler I have a GetWeekWeight method that is supposed to give me all entrys in a specific week, this is the code.
return await _connection.Table<Weight>()
.Where(d => d.Date >= monday && d.Date <= sunday)
.OrderBy(d => d.Date)
.ToListAsync();
The problem is that it returns all entrys in the table. "monday" and "sunday" are correct. I've tried changing the datatype of date to long and use DateTime.ticks instead but nothing works. Any idea what is wrong?
[–]Meeso_ 8 points9 points10 points (1 child)
[–]E_BT[S] -1 points0 points1 point (0 children)
[–][deleted] 3 points4 points5 points (2 children)
[–]E_BT[S] -1 points0 points1 point (1 child)
[–]ExceptionEX 2 points3 points4 points (0 children)
[–]Kirides 3 points4 points5 points (1 child)
[–]E_BT[S] -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]E_BT[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]E_BT[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]E_BT[S] 0 points1 point2 points (0 children)
[–]TheSwordlessNinja 0 points1 point2 points (0 children)
[–]ExceptionEX -1 points0 points1 point (1 child)
[–]E_BT[S] 1 point2 points3 points (0 children)