I have a table that has date time stored as follows
2022-02-01 17:47:50.3483971 +00:00
2022-05-11 18:47:50.3483971 +00:00
2022-05-21 14:40:50.3483971 +00:00
I'm trying to write a linq query that will compare get results for the date passed but i only want to pass in the date, for example get the records from 2022/02/01
so I tried
var fdate= query.filteredDate.LocalDateTime.ToShortDateString(); // this gets the date the user passes in.
the problem comes in the where clause when I try this
filteredResult.Where(x=> fdate >= DateTime.Parse(x.storeddate.LocalDateTime.ToShortDateString()))
then it errors out and says can not be applied to string and datetime
so I tried this
Where(x=> fdate >= x.storeddate.LocalDateTime.ToShortDateString()))
and it says can not be applied to string and string
what am I doing wrong?