Thanks for your input as well, Jeffrey Williams. I do have a question...does anyone know how to get the last day of the month, instead of using the '01'? I'm wondering how this could be accomplished, due to some months having 28 or 29 days (depending on if it's a leap year or not), or 30, or 31 days.
SELECT DATEADD(MONTH, -1, CONVERT(date, CAST(ppr.ReportDateYearMonth AS char(6))+'01', 112)) AS PeriodEndCalendar
I've tried the EOMONTH function, but it's not looking correct, as I checked and it's returning 30 for some of the months where there are 31 days:
DATEADD(MONTH, -1, EOMONTH(CONVERT(date, CAST(ppr.ReportDateYearMonth AS char(6))+'01', 112))) AS PeriodEndCalendar
I'd appreciate any pointers on this. Thanks!