ۥ-x@ -Zw    " " " " . 8 " B B   4  Crystal Reports Technical Document Subject: PADDING DATES WITH ZEROS FOR MONTHS AND DAYS LESS THAN 10 Date: Sept 16, 1993 Versions: 1.0, 2.0(Std), 2.0(Pro), VB Situation: When the following formula is used newdate := ToText(Year ({bookord.Date}))+ToText(Month({bookord.Date}))+ToText(Day({bookord.Date})), the values that are returned are dependant upon what month or day it is. The various combinations are: OUTPUT (Year, Month, Day) 199311 (1993, 1, 1) 1993118 (1993, 11, 8) 1993416 (1993, 4, 16) 19931224 (1993, 12, 24) If a group is created on this formula and then sorted, it will not work properly. Solution: To solve this problem, a formula which puts zeros in for months and days less than 10 is needed. The following represents such a formula: StringVar newdate; newdate := ToText(Year ({bookord.Date}))+ToText(Month({bookord.Date}))+ToText(Day({bookord.Date})); if Day({bookord.Date}) < 10 and Month({bookord.Date}) < 10 then newdate := newdate[1 to 4] + "0" + newdate[5] + "0" + newdate[6] else if Day({bookord.Date}) < 10 and Month({bookord.Date}) > 9 then newdate := newdate[1 to 6] + "0" + newdate[7] else if Day({bookord.Date}) > 9 and Month({bookord.Date}) < 10 then newdate := newdate[1 to 4] + "0" + newdate[5 to 7] else newdate; newdate Remarks: {file name} )+    +-9;_.0Qo +-68y8@  0*0* 0* 0* h 0* h  h3!-TECHDOC;B 4$MOBTimes New Roman Symbol&Arial5Courier New 1Courier99 9"h3م4م uT:\WINDOWS\WINWORD\TDTEMPLT.DOT PADDING DATES+Padding Months and Days Less than 10 with 0Date Mike Strobeljennifer