PLAT-ADMN-202 practice question 28 of 35

The Director of Marketing at Northern Trail Outfitters wants the app builder to create a formula field that tracks how many days have elapsed since a contact was sent a marketing communication. The director is only interested in whole units. Which function should be used to return a date for calculating the difference?

Full set: 311 questions

Domain Sales and Marketing Applications

Answer options
A: DATFTIMEVALUE()
B: TODAY() Correct answer
C: DATEVALUE()
D: NOW()
Correct Answer:
B. TODAY()
Explanation

To calculate the number of elapsed days in whole units, the formula needs to subtract a past date from the current date. The TODAY() function returns the current date as a Date data type, without any time component. Using TODAY() in a formula such as TODAY() - MarketingCommunicationDatec will result in a number representing the difference in whole days, directly fulfilling the requirement.

Why Incorrect

A. DATETIMEVALUE(): This function converts a text or date expression into a DateTime data type. It does not return the current date and is used for data type conversion.
C. DATEVALUE(): This function converts a DateTime or text expression into a Date data type, stripping the time component. It is used for conversion, not for retrieving the current date.
D. NOW(): This function returns the current date and time as a DateTime data type. Using it for this calculation would result in a fractional number, which contradicts the requirement for whole units.

References

1. Salesforce Help Documentation, "Formula Operators and Functions I–Z":

TODAY(): "Returns the current date as a date data type." This aligns with the need for a date-only value to calculate whole days.

NOW(): "Returns a datetime value representing the current moment." The inclusion of time makes it unsuitable for calculating whole days without additional functions.

DATEVALUE(expression): "Returns a date value from a date/time or text expression." This describes a conversion function, not one that provides the current date.

DATETIMEVALUE(expression): "Returns a year, month, day, and GMT time value." This also describes a conversion function.

2. Salesforce Trailhead, "Use Formula Fields" Module, "Use Basic Logic in Checkbox Formulas" Unit:

This unit provides examples of date formulas. It implicitly distinguishes between TODAY() for date-only calculations and NOW() for date-and-time calculations, reinforcing that TODAY() is the correct choice for calculating the number of days. For example, IF(CloseDate < TODAY(), 1, 0) evaluates based on the current date.

Scroll to Top