How to get data yesterday

similar to
MyDateTimeVar.AddDays(new Double(){0,-2,0,0,0,0,0}(MyDateTimeVar.DayOfWeek)).Date