Using date and time functions
Date and time functions are the most important functions as the main data context of analysis is time.
Date and time functions can convert dates into time portions, calculate time differences between dates, and be the basis for advanced time filtering, such as current week, last month, and other time portions.
The main date and time functions are as follows:
CurrentDate
: This returns the current data value; it is great for calculating time differences.Daysbetween
: This calculates the number of days between two dates (the order date and arrival date).Todate
: This converts a string object into a date type object. This option is great for when we have string objects that we need to sort chronologically or use in other date calculations.Relativedate
: This function is very useful for when we are required to add or subtract days from a date; for example, we might be required to check which free offers that were issued to the customers have exceeded their 30-day validity...