Adds a random number of days between 0 and nDays to a date and formats this date into the specified format. The random values generated are distributed uniformly.
Kernel.bdh
RndFormatDate( in nDate : number, in nDays : number, in sFormat : string in bLocalized : boolean optional ): string;
formatted date string
Parameter | Description |
---|---|
nDate | Input date with format YYYYMMDD |
nDays | Upper boundary of random interval for days to add |
sFormat | Format control string (FormatDate) |
bLocalized | If True, returns the localized date format (optional). |
dcltrans transaction TRndFormatDate var sNewDate: string; begin // add 0 - 20 days to 19961015 and format it to "1996-11-10" sNewDate := RndFormatDate(19961015, 20, DATE_YYYY_MM_DD); write("newdate = "); write(sNewDate); writeln; end TRndFormatDate;
newdate = 1996-10-30
OraSample.bdf, DBApi01.bdf