Easy Peasy Date Filters in Salesforce Reports

Easy Peasy Date Filters in Salesforce Reports

Relative Dynamic Date Filters Reports

Do you need to run reports that show records that have 2 relative date filters?

Say, all contacts that were created last year AND whose feedback date was last year?

It’s simple to filter reports by one date field. Use the Date Field drop down in the filter section of the report editor and choose your relative Date Range.

But if you want to filter on another date you need to add a new filter which doesn’t give you the Date Range drop-down.  Luckily Salesforce allows you to type in the same ranges using “special date values”.  So you can add a filter field and select the other date field and type the relative value in the spot where you would normally put one date.

Here is a list of all the relative date values you can type in:

*note that the values are not case-sensitive and you can substitute the variable (“NEXT N DAYS”) with any number greater than 0

Special Date ValueRange
YESTERDAYStarts at 12:00:00 a.m. on the day before the current day and continues for 24 hours.
TODAYStarts at 12:00:00 a.m. on the current day and continues for 24 hours.
TOMORROWStarts at 12:00:00 a.m. on the day after the current day and continues for 24 hours.
LAST WEEKStarts at 12:00:00 a.m. on the first day of the week before the current week and continues for seven days.

The week is defined by the Locale drop-down list in your personal information settings at Your Name | Setup | My Personal Information | Personal Information. For example, when the Locale is US English, a week runs Sunday to Saturday, whereas with UK English, a week spans Monday to Sunday.

THIS WEEKStarts at 12:00:00 a.m. on the first day of the current week and continues for seven days.

The week is defined by the Locale drop-down list in your personal information settings at Your Name | Setup | My Personal Information | Personal Information. For example, when the Locale is US English, a week runs Sunday to Saturday, whereas with UK English, a week spans Monday to Sunday.

NEXT WEEKStarts at 12:00:00 a.m. on the first day of the week after the current week and continues for seven days.

The week is defined by the Locale drop-down list in your personal information settings at Your Name | Setup | My Personal Information | Personal Information. For example, when the Locale is US English, a week runs Sunday to Saturday, whereas with UK English, a week spans Monday to Sunday.

Month

LAST MONTHStarts at 12:00:00 a.m. on the first day of the month before the current month and continues for all the days of that month.
THIS MONTHStarts at 12:00:00 a.m. on the first day of the current month and continues for all the days of that month.
NEXT MONTHStarts at 12:00:00 a.m. on the first day of the month after the current month and continues for all the days of that month.

 

Day

LAST 90 DAYSStarts at 12:00:00 a.m. 90 days before the current day and continues up to the current second. (The range includes today.)
NEXT 90 DAYSStarts at 12:00:00 a.m. on the day after the current day and continues for 90 days. (The range does not include today.)
LAST n DAYSStarts at 12:00:00 a.m. n days before the current day and continues up to the current second. (The range includes today.)
NEXT n DAYSStarts at 12:00:00 a.m. on the next day and continues for the next n days. (The range does not include today.)

 

Quarter

LAST QUARTERStarts at 12:00:00 a.m. on the first day of the quarter before the current quarter and continues to the end of that quarter.
THIS QUARTERStarts at 12:00:00 a.m. on the first day of the current quarter and continues to the end of the quarter.
NEXT QUARTERStarts at 12:00:00 a.m. on the first day of the quarter after the current quarter and continues to the end of that quarter.
LAST n QUARTERSStarts at 12:00:00 a.m. on the first day of the quarter n quarters ago and continues to the end of the quarter before the current quarter. (The range does not include the current quarter.)
NEXT n QUARTERSStarts at 12:00:00 a.m. on the first day of the quarter after the current quarter and continues to the end of the quarter n quarters in the future. (The range does not include the current quarter.)

 

Year

LAST YEARStarts at 12:00:00 a.m. on January 1 of the year before the current year and continues through the end of December 31 of that year.
THIS YEARStarts at 12:00:00 a.m. on January 1 of the current year and continues through the end of December 31 of the current year.
NEXT YEARStarts at 12:00:00 a.m. on January 1 of the year after the current year and continues through the end of December 31 of that year.
LAST n YEARSStarts at 12:00:00 a.m. on January 1 of the year n years ago and continues through December 31 of the year before the current year.
NEXT n YEARSStarts at 12:00:00 a.m. on January 1 of the year after the current year and continues through the end of December 31 of the nth year.

 

Fiscal Quarter

LAST FISCAL QUARTERStarts at 12:00:00 a.m. on the first day of the fiscal quarter before the current fiscal quarter and continues through the last day of that fiscal quarter. The fiscal quarter is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
THIS FISCAL QUARTERStarts at 12:00:00 a.m. on the first day of the current fiscal quarter and continues through the end of the last day of the current fiscal quarter. The fiscal quarter is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
NEXT FISCAL QUARTERStarts at 12:00:00 a.m. on the first day of the fiscal quarter after the current fiscal quarter and continues through the last day of that fiscal quarter. (The range does not include the current quarter.) The fiscal quarter is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
LAST n FISCAL QUARTERSStarts at 12:00:00 a.m. on the first day of the fiscal quarter n fiscal quarters ago and continues through the end of the last day of the previous fiscal quarter. (The range does not include the current fiscal quarter.) The fiscal quarter is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
NEXT n FISCAL QUARTERSStarts at 12:00:00 a.m. on the first day of the fiscal quarter after the current fiscal quarter and continues through the end of the last day of the nth fiscal quarter. (The range does not include the current fiscal quarter.) The fiscal quarter is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.

 

Fiscal Year

LAST FISCAL YEARStarts at 12:00:00 a.m. on the first day of the fiscal year before the current fiscal year and continues through the end of the last day of that fiscal year. The fiscal year is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
THIS FISCAL YEARStarts at 12:00:00 a.m. on the first day of the current fiscal year and continues through the end of the last day of the fiscal year. The fiscal year is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
NEXT FISCAL YEARStarts at 12:00:00 a.m. on the first day of the fiscal year after the current fiscal year and continues through the end of the last day of that fiscal year. The fiscal year is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
LAST n FISCAL YEARSStarts at 12:00:00 a.m. on the first day of the fiscal year n fiscal years ago and continues through the end of the last day of the fiscal year before the current fiscal year. (The range does not include the current fiscal year.) The fiscal year is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.
NEXT n FISCAL YEARSStarts at 12:00:00 a.m. on the first day of the fiscal year after the current fiscal year and continues through the end of the last day of the nth fiscal year. (The range does not include the current fiscal year.) The fiscal year is defined in the company profile at Your Name | Setup | Company Profile | Fiscal Year.

 

Check out the list of relative date filters from Salesforce knowledge base!