I want to get my mails filtering by yesterday to today. For this i want to use outlook filtering option method instead of mail.header(“date”).
When i put " [ReceivedTime] >= ‘07/29/2019’ AND [ReceivedTime] <= ‘07/30/2019’ " That work!
But when i replace fixed date by now.date.AddDays(-1).ToString(“MM/dd/yyyy”) and now.date.ToString(“MM/dd/yyyy”) that doesnt work
hmmm help me please (i already checked other post in the forum)
check this condition
assign two variables like “ToadysDate = System.DateTime.Now” and “YesterdaysDate = now.AddDays(-1)” and using this filter condition check the screenshot also
“[ReceivedTime]>='”+YesterdaysDate.ToString(“MM/dd/yyyy”)+“'” +“And”+“[ReceivedTime]<='”+ToadysDate.ToString(“MM/dd/yyyy”)+“'”
try this one and solve your problem