How To: Date Fields
If your date fields are printing something like this on your report:
92716
there is no need for panic. Your database application is storing date field information as a five digit number to be avoid the dreaded Y2K problem of 2000 (i.e. date fields were stored as a two digit year - when it became 2000 the database didn't know if it was 1900 or 2000). This is a GOOD Thing; your problem of printing the date information in a more understandable format is achieved by using the FORMAT() function and the appropriate Picture.
Let's assume that you have a database field named "CUS:BDATE", and it stores the customer's birthday. When you print this database field onto a report page it prints using the 5 digit number. The FORMAT() function is passed the database field that needs manipulated (CUS:BDATE) and the type of Picture that you desire to change it's output:
Desired Output Format Picture To Use Example
mm/dd/yy @D1 format(CUS:BDATE, @D1)
mm/dd/yyyy @D2 format(CUS:BDATE, @D2)
mm dd, yyyy @D3 format(CUS:BDATE, @D3)
mmmmmmmmm dd, yyyy @D4 format(CUS:BDATE, @D4)
dd/mm/yy @D5 format(CUS:BDATE, @D5)
dd/mm/yyyy @D6 format(CUS:BDATE, @D6)
dd mmm yy @D7 format(CUS:BDATE, @D7)
dd mmm yyyy @D8 format(CUS:BDATE, @D8)
yy/mm/dd @D9 format(CUS:BDATE, @D9)
yyyy/mm/dd @D10 format(CUS:BDATE, @D10)
yymmdd @D11 format(CUS:BDATE, @D11)
yyyymmdd @D12 format(CUS:BDATE, @D12)
mm/yy @D13 format(CUS:BDATE, @D13)
mm/yyyy @D14 format(CUS:BDATE, @D14)
yy/mm @D15 format(CUS:BDATE, @D15)
yyyy/mm @D16 format(CUS:BDATE, @D16)
The first nine examples above (@D1-@D9) will NOT print a leading zero if the day of the month is 1-9, or when the month number is 1-9 - for example, if the date is 1 Jan 2000 and the @D1 picture is used the output would be 1/1/00. To change the output to 01/01/00 you would change the format string to:
format(CUS:BDATE, @D01)
You would do likewise for the @D2-@D9 pictures (making them @D02, @D03, etc).