timestampadd 6 months ago
How do I do a timestampadd function so that it gives me the first day of the month 6 months ago?
For example, a user selects 10/31/2009. I need a column that will return the 1st of the month 6 months prior which is 5/1/2009. This is the formula that I am using:
MIN(TIMESTAMPADD(SQL_TSI_MONTH,-6,MAX(Time.Date)))
It works in some cases but not others because some months have 30 days and others have 31 or 28. Any ideas how I can achieve this?
Thanks