How to retrieve previous 7 days data from today

Hi @Ishan_Shelke ,

Could you maybe check on the below Expression :

DT.AsEnumerable.Where(Function(x)CDate(x("MailSentDateTime").ToString).Date<Now.Date andAlso DateDiff(DateInterval.Day,CDate(x("MailSentDateTime").ToString).Date,Now.Date)<=7).CopyToDatatable

Let us know if this doesn’t work.

2 Likes