When I hover over the YTD1Month part of the line of code after it executes I do not see what the value is. I added a watch to the variable and it is telling me:

The name 'YTD1Month' does not exist in the current context

Can anyone explain this to me?


Code:
String YTD1Month = MonthDate(DateRangeEnd, -1);

Here is MonthDate:
Code:
        public string MonthDate(String EndingDate, int MonthsToSubtract)
        {
            DateTime dt = new DateTime();

            if (DateTime.TryParse(EndingDate, out dt))
            {
                dt = dt.AddMonths(MonthsToSubtract);
                return dt.ToShortDateString();
            }
            else
            {
                return "";
            }           
        }