Search code examples
datetimecrystal-reportsformat

custom date formatting in crystal report


I am working on crysstal report and I need to format the date in the following format.

    • Format= D16C30HO in above format fields are
    • D=prefix Hard code value
    • 16=year value of systems date
    • C=Month value of systems date like A=1. January, B=2. February, C=3. March ....
    • 30=day value of system's Date
    • HO=hard code value.
    • I am a beginner for crystal report. is there any option to format that crystal report provide us for such purposes ?

Solution

  • local datevar A := currentdate;
    "D" &
    totext(A,"yy") &
    chr(65+asc(totext(A,"M"))-49) &
    totext(A,"0M") &
    "HO"