Function Dates Times Class

DateTo4CharString

"Date To Four Character String" Converts the date portion of a date/time value into a four-character string. The resolution is one day. The range is one decade. This string is suitable for use as the prefix for a file name.

Signature (Visual Basic / VBA)

Public Function DateTo4CharString( _
    ByVal vDate As Variant _
    ) As Variant

Code Examples

    DateTo4CharString(#2/13/92#) = "2B13"
    DateTo4CharString(#2/14/92#) = "2B14"
    DateTo4CharString(#5/30/94#) = "4E30"
    DateTo4CharString(#5/30/84#) = "4E30"
    1) the last digit of the year (0..9)
    2) the month represented by a letter (A..L)
    3) the day (01..31)

Parameters

Parameter Description
vDate The date which is returned as a four-character string. Function returns Null if vDate is Null or cannot be fixed up to a Date.

Return Value

The return value is composed of:

Notes & Version History

Details Examples: