Date.IsInPreviousWeek

This function determines if the provided datetime value, dateTime, falls within the previous week based on the current date and time of the system. It is important to note that when a value within the...

Syntax

Date.IsInPreviousWeek(dateTime as any) as nullable logical

About

This function determines if the provided datetime value, dateTime, falls within the previous week based on the current date and time of the system. It is important to note that when a value within the current week is passed, the function will return false. dateTime: A value representing a date, datetime, or datetimezone that is being assessed.

Explanation

Identify whether the week preceding the current system time falls within the previous week using a technical function called MDate.IsInPreviousWeek, which computes the difference between dates. For instance, if the current system time is subtracted by 7 days to get the date from a week ago, the function will return a true boolean value if that date is indeed within the previous week.