(GETDATE('parameters'))
GETDATE will display a graphic calendar interface with today's date circled. After a day is selected, the date is returned to the variable. Based on the calendar type, different methods are used to navigate the months and years.
Parameters |
Values |
Description |
calendar caption |
value |
specifies a caption for the calendar window |
CALENDAR_TYPE |
STANDARD ENHANCED |
specifies the calendar type. STANDARD will display the default calendar for the operating system. ENHANCED will display a custom calendar. |
CALENDAR_FONT_NAME |
value |
specifies the font name for the calendar |
CALENDAR_FONT_SIZE |
value |
specifies the font size for the calendar |
FONT_NAME |
value |
specifies the font name for the calendar and buttons |
FONT_SIZE |
value |
specifies the font size for the calendar and buttons |
INIT_VAR |
variable |
specifies the initial value variable assigned with the default date |
SHOW_TODAY_CIRCLE |
ON OFF |
specifies whether to display the circle for today's date |
THEMENAME |
value |
specifies a theme that will be applied to the calendar window |
Notes:
•The parameters must be enclosed in quotes.
•The parameters must be separated with the pipe character "|".
•By default, the CALENDAR_TYPE is STANDARD and SHOW_TODAY_CIRCLE is ON.
•Using the enhanced calendar, an additional "Clear" button is available to clear the selection. Both calendar types allow to select a today option and use today's date as the selected value.
Examples:
-- Example 01 (Standard calendar with a default date, font name, and font size):
SET VAR vDate DATE = NULL
SET VAR vDefaultDate DATE = 07/31/2020
SET VAR vDate = (GETDATE('Select Date|INIT_VAR vDefaultDate|FONT_NAME Georgia|FONT_SIZE 14'))
RETURN
-- Example 02 (Enhanced calendar with a default date, theme, and custom font size):
SET VAR vDefaultDate DATE = 07/31/2020
SET VAR vDate = +
(GETDATE('Select Date|INIT_VAR vDefaultDate|CALENDAR_TYPE ENHANCED|THEMENAME QNX|FONT_SIZE 14'))
RETURN
-- Example 03 (Dynamic approach using global variables)
SET VAR vDate DATE = NULL
SET VAR vCaption TEXT = 'Select Date'
SET VAR vCalendarType TEXT = 'ENHANCED'
SET VAR vThemeName TEXT = 'Vista CG'
SET VAR vQuotes = (CVAL('QUOTES'))
SET VAR vFontSize TEXT = '12'
SET VAR vFontName TEXT = 'Verdana'
SET VAR vString TEXT = +
('SET VAR vDate = (GETDATE('+.vQuotes+.vCaption+ +
'|CALENDAR_TYPE '+.vCalendarType+ +
'|THEMENAME '+.vThemeName+ +
'|FONT_SIZE '+.vFontSize+ +
'|FONT_NAME '+.vFontName+.vQuotes+'))')
&vString
CLEAR VARIABLE vCaption,vCalendarType,vThemeName,+
vQuotes,vString,vFontSize,vFontName
RETURN