C# Linq Where Date Between 2 Dates

后端 未结 8 2069
鱼传尺愫
鱼传尺愫 2020-11-28 07:30

I\'m trying to get my linq statement to get me all records between two dates, and I\'m not quite sure what I need to change to get it to work: (a.Start >= startDate

8条回答
  •  悲哀的现实
    2020-11-28 08:00

    Just change it to

    var appointmentNoShow = from a in appointments
                            from p in properties
                            from c in clients
                            where a.Id == p.OID && 
                           (a.Start.Date >= startDate.Date && a.Start.Date <= endDate)
    

提交回复
热议问题