InterSystems MDX Reference
NOW Member


This section provides information on the NOW member for date/time levels. This syntax is an InterSystems extension to MDX.
Basic Syntax
Where:
This syntax returns the member of the given level that corresponds to the current date and time. The following table shows examples (created on 24 May 2012):
NOW is not casesensitive. Also, the square brackets around it are optional unless you are using one of the variations discussed below in this topic.
You can also use expressions of the following form:
date_time_level.[NOWinteger]
Or:
date_time_level.[NOW+integer]
The following table shows examples (created on 24 May 2012):
Be careful when using such expressions with a time level that is independent of the overall calendar. In such cases, [NOW
integer] refers to an earlier bucket in a cycle. Notice the third example in the table. The
birthqd.quarter level groups records by quarter, independent of year. For this level, NOW refers only to the current quarter number. This level has four members in a cycle, and for this level, [NOW4] is equivalent to [NOW].
The same logic applies to expressions of the form [NOW+
integer].
You cannot use NOW in range expressions for a level that is based on any of the following time functions:
For a level that is based on the
DayMonthYear time function, Business Intelligence supports the additional expressions that use a combination of year count, month count, and day count, as follows:
daymonthyear_level.[NOWoffset_expression]
Or:
daymonthyear_level.[NOW+offset_expression]

nn is a one or two digit integer.

The optional unit
nny specifies the number of years.

The optional unit
nnm specifies the number of months.

The optional unit
nnd specifies the number of days.
The following table shows examples (created on 24 May 2012):
By default, the units are added together. For example,
4y3m2d means four years plus three months plus two days.
You can instead include a minus sign between units to subtract.
1y1d means one year, minus one day. For example:
The system automatically accounts for leap years. The internal logic also accounts for the varying lengths of the months.
Content Date/Time: 20190423 15:16:10