This section covers date-related functions for calculating time differences, extracting date components, and working with the current date. These functions are useful for managing billing cycles, tracking subscription durations, and analyzing transaction trends over time.
DATEDIF(start_date, end_date, "unit")
DATEDIF(activated_at, today(), "M")
to get the total number of months between the start date and today.EOMONTH(start_date, months)
EOMONTH(today(), 0)
to get the last day of the current month.MONTH(date)
MONTH(transaction_date)
to convert a date to a month number.YEAR(date)
YEAR(due_date)
with YEAR(today())
to check if the years match.today()
today()
with the next_billing_at
date to trigger an alert if they match.This section covers date-related functions for calculating time differences, extracting date components, and working with the current date. These functions are useful for managing billing cycles, tracking subscription durations, and analyzing transaction trends over time.
DATEDIF(start_date, end_date, "unit")
DATEDIF(activated_at, today(), "M")
to get the total number of months between the start date and today.EOMONTH(start_date, months)
EOMONTH(today(), 0)
to get the last day of the current month.MONTH(date)
MONTH(transaction_date)
to convert a date to a month number.YEAR(date)
YEAR(due_date)
with YEAR(today())
to check if the years match.today()
today()
with the next_billing_at
date to trigger an alert if they match.