DMY2DATE and DWY2DATE functions
DMY2DATE
allows us to create a date from integer values (or defaults) representing the day of the month, month of the year, and the four-digit year. If an optional parameter (MonthValue
or YearValue
) is not specified, the corresponding value from the
System Date is used. The syntax is as follows:
DateVariable := DMY2DATE ( DayValue [, MonthValue] [, YearValue] )
The only way to have the function use the Work Date values for Month and Year is to extract those values and then use them explicitly. An example is as follows:
DateVariable := DMY2DATE(22,DATE2MDY(WORKDATE,2),DATE2MDY(WORKDATE,3))
Note
This example also illustrates how expressions can be built up of nested expressions and functions. We have WORKDATE
within DATE2MDY
within DMY2DATE
.
DWY2DATE
operates similarly to DMY2DATE
; allowing us to create a date from integer values representing the day of the week (from 1 to 7 representing Monday to Sunday), week of the year (from 1 to 53) followed...