groupdatepattern(
DATE
,
PATTERN
)

The groupdatepattern( function converts a number representing a date into text in a special format for use with the summarytable( and crosstab( functions. The function uses a pattern to control how the date is formatted (see Date Patterns).


Parameters

This function has two parameters:

date – is the number you want to convert to text. This number is treated as the number of days since January 1, 4713 B.C.

pattern – is text that contains a pattern for formatting the date (see Date Patterns).


Description

This function converts a number representing a date into text in a special format for use with the summarytable( and crosstab( functions. The function uses a pattern to control how the date is formatted (see Date Patterns).

groupdatepattern(Date,"mm/dd/yy") ☞ 8/9/12
groupdatepattern(Date,"MM/DD/YY") ☞ 08/09/12
groupdatepattern(Date,"mm/dd/yyyy") ☞ 8/9/2012
groupdatepattern(Date,"Mon yy") ☞ Aug 12
groupdatepattern(Date,"Month yyyy") ☞ August 2012
groupdatepattern(Date,"MON-yy") ☞ AUG-12
groupdatepattern(Date,{Qtr "Quarter" yyyy}) ☞ 3rd Quarter 2012
groupdatepattern(Date,{yyyy}) ☞ 2012

Technical Note: This function should only be used with the summarytable( and crosstab( functions. The groupdatepattern( function appends a special prefix to the output that allows these functions to list the date values chronologically instead of alphabetically. These functions automatically strip out the prefix before displaying the date, but if you use this function anywhere else, the prefix will be visible. Use the datepattern( function if you don’t want this special prefix (basically always except when using the summarytable( and crosstab( functions).


See Also


History

VersionStatusNotes
10.1NewNew in this version.