Date Intrinsic Functions - AsNumber Method

Return the variable as a number

Member of Date Intrinsic Functions (PRIM_LIBI.IDateIntrinsics)

Parameters

NameTypeData TypeDescription
Result*Result (Optional)IntegerResulting number
Format*InputEnumerationFormat of the number

Details

AsNumber will convert a variable to a number. If the variable contains characters that cannot be converted, the application will end with a run time error.

Allowed Formats

Enum ValueDescription
CCYYDDMMe.g. 20143112
CCYYMM e.g. 201431
CCYYMMDD e.g. 20141231
Days e.g. 735597 for 2014-31-12 (Days since 01-01-0000)
DDMMCCYY e.g. 31122014
DDMMYY e.g. 311214
MMCCYY e.g. 122014
MMDDCCYY e.g. 12312014
MMDDYY e.g. 123114
MMYY e.g. 1214
SysFmt6 e.g. 311214 (Operating system format)
SysFmt8 e.g. 31122014 (Operating system format)
xYYMMDD e.g. 1141231 (First digit is 1 if the date is later than the LANSA year comparison value, otherwise it's 0)
YYMM e.g. 1412
YYMMDD e.g. 141231

Example

#Result := #Variable.AsNumber(DDMMYY)

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2