ADMIN_GetDynamicDateInterval

 Show all Hide all

Deprecated.

Returns the start and stop date of the dynamic date interval given by specifying a date interval enum and a reference date.

If you for example are interested in getting the start and stop dates of the preceding month you would set the enum-parameter to 'LASTMONTH' and the date-parameter to getdate().

This type of functionality is very useful in cases where the user wants the option to choose simple predefined date intervals in reference to a date, such as when creating a subscription to a statistics report etc.

Currently supported interval enums:
TODAY
YESTERDAY
WHOLEMONTHSTHISYEAR
LASTWEEK
LASTMONTH
LASTYEAR

Type: Table-valued function
Area of use: General use

Parameters:

@DateIntervalEnum mandatory varchar(50)
The date interval enum to use. See main function description for available options.
@ReferenceDate mandatory datetime
The reference date.

Resultsets:

Resultset: Dynamic date interval

Repeat mode: repeated exactly once
Row count: exactly one row

Columns:

DateIntervalStart mandatory datetime
The start date of the dynamic interval.
DateIntervalStop mandatory datetime
The stop date of the dynamic interval.