Filter Outlook Items by Date with LINQ to DASL

I received an email over the weekend asking why the following LINQ to DASL query threw an exception: Outlook.Folder folder = (Outlook.Folder)Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar); var appointments = from item in folder.Items.AsQueryable<Appointment>() where item.Categories.Contains(“Personal Appointments”) && item.Item.Start.Date >= DateTime.Now – new TimeSpan(30, 0, 0, 0) select item.Item; foreach (var appointment in appointments) { MessageBox.Show(appointment.Start.ToString()); } The query looks…

8