I am new to using T-SQL, so there is probably an easy way to accomplish this, but I can't seem to get it right. I want to retrieve the previous day's date (requires a weekday) to use as a comparsioin to a date field in the table, format is YYYYMMDD. When the current date is a Monday, I need to subtract 3 days from current date, otherwise subtract 1 day.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!