Date Filters

MXO provides a wide variety of date filters for you to use when writing your engagement queries, enabling you to specify the exact time period for which you want to return data about an audience.

Date Filters

You can use any of the following date filters in your engagement queries:

FormatDescriptionResolves toNotes
wheneverInclude data from/to the maximum internal period defined in ONE.90 days prior to now, when used as a start date. now when used as an end date.
#NOW [+/- N units]Include data from/to the time the query is run.The exact date/time the query is run.Can be paired with a relative interval (seconds, hours, days, weeks, months).
#CURRENT_DAY

[+/- N units]

Include data from/to midnight on the day the query is run.If the query is run on October 12th, 2021 14:25:30: October 12th 2021 00:00:00Can be paired with a relative interval (seconds, hours, days, weeks, months).
#CURRENT_WEEK

[+/- N units]

Include data from/to midnight on the Sunday before the query is run.If the query is run on October 12th, 2021 14:25:30: October 10th 2021 00:00:00Can be paired with a relative interval (seconds, hours, days, weeks, months).
#CURRENT_MONTH

[+/- N units]

Include data from/to midnight on the 1st day of the month in which the query in run.If the query is run on October 12th, 2021 14:25:30: October 1st 2021 00:00:00Can be paired with a relative interval (seconds, hours, days, weeks, months).

[month]

Include data from/to the date/time specified.The exact date/time specified in the query.

Pre-defined Date Snippets

As well as supplying individual date filters, MXO also provides you with several pre-defined date snippets to make setting up your queries even easier.

FormatExample Queries
Todayexport all customer data for date (2021-10-12 00:00) discover journeys from interaction (date (2021-10-12 00:00))
Yesterdayexport all customer data for date (2021-10-11 00:00) discover journeys from interaction (date (2021-10-11 00:00))
Last Weekexport all customer data for date (#CURRENT_WEEK - 1 week, #CURRENT_WEEK) discover journeys from interaction (date(#CURRENT_WEEK - 1 week, #CURRENT_WEEK))
Last Monthexport all customer data for date (#CURRENT_MONTH - 1 month, #CURRENT_MONTH) discover journeys from interaction (date(#CURRENT_MONTH - 1 month, #CURRENT_MONTH))
Last 90 Daysexport all customer data for date (#CURRENT_DAY - 90 days, #CURRENT_DAY) discover journeys from interaction (#CURRENT_DAY - 90 days, #CURRENT_DAY))
Last N Daysexport all customer data for date (#CURRENT_DAY - 30 days, #CURRENT_DAY) discover journeys from interaction (#CURRENT_DAY - 30 days, #CURRENT_DAY))
Last N Weeksexport all customer data for date (#CURRENT_WEEK - 3 weeks, #CURRENT_WEEK) discover journeys from interaction (date(#CURRENT_WEEK - 3 weeks, #CURRENT_WEEK))
Last N Monthsexport all customer data for date (#CURRENT_MONTH - 2 months, #CURRENT_MONTH) discover journeys from interaction (date(#CURRENT_MONTH - 2s month, #CURRENT_MONTH))

Date Formatting Rules

EQL uses the following rules to parse dates:

  • Date ranges require two values. If either end of the range is not used, the value can either be left blank or the keyword whenever used.For example: date(,2021-10-12 00:00) and date(whenever,2021-10-12 00:00) are synonymous and mean from 90 days prior to October 12, 2021 to October 12, 2021.
  • When date is used within the interaction or action context it is simply date(a, b); that is, it does not support the assignment = parameter.
  • Date ranges are closed on the left and open on the right. That is, [start, end).
  • Dates must be specified as YYYY-MM-DD HH:MM.
  • Timestamps are not supported. It is assumed that the date provided matches the time zones for the data, as well as the date format.