I've been working with a Custom Function that generates a list of dates based on 2 input dates (start date and end date) as follows:

If(

GetAsDate ( EndDate ) > GetAsDate ( StartDate );

GetAsDate ( StartDate ) & ¶ &

DateRange (GetAsDate ( StartDate ) + 1; EndDate );

GetAsDate ( StartDate )

)

The list of dates that is returned (in DD/MM/YYYY) format might look as follows:

29/09/2014

30/09/2014

1/10/2014

2/10/2014

3/10/2014

I need to have the list always show the dates with leading zeros for the day and month, i.e.:

29/09/2014

30/09/2014

01/10/2014

02/10/2014

03/10/2014

I haven't been able to work this out so far - can anybody help with the required modification to have the date range in DD/MM/YYYY with leading zeros for the DD and MM?

thanks,

Steve

Modified Custom function:

(Don't copy the lines with stars).

Start Function *****

Let ( [

start = GetAsDate ( StartDate ) ;

end = GetAsDate ( EndDate ) ;

startDay = Right ( "0" & Day ( start ) ; 2 ) ;

startMonth = Right ( "0" & Month ( start ) ; 2 ) ;

startYear = Year ( start ) ;

startText = Substitute ( List ( startDay ; startMonth ; startYear ) ; "¶" ; "/" ) ] ;

If ( end > start - 1 ;

List ( startText ; DateRange ( start + 1 ; end ) ;

)

)

)

End Function *****

I tested the function in the data viewer using this calc:

Let ( [

StartDate = "9/28/14" ;

EndDate = "10/10/14" ] ;

DateRange ( StartDate ; EndDate )

)

Results:

28/09/2014

29/09/2014

30/09/2014

01/10/2014

02/10/2014

03/10/2014

04/10/2014

05/10/2014

06/10/2014

07/10/2014

08/10/2014

09/10/2014

10/10/2014