I am trying to use the Date function to return a date range from the current date to 5 days back. The trick is it needs to be formatted like this:
Below is my orginal code. However, as I discovered this morning, it doesn't take into consideration month changes or leap years. Is there an easy way to do this??
daysBack = Year(Date) & "-" & Month(Date) & "-" & Day(Date) - 5
currentDate = Year(Date) & "-" & Month(Date) & "-" & Day(Date)
rangeDate = daysBack & "-" & currentDate