>> I want to programmatically create a consecutive list of months/dates
>> starting from a certain month, eg
Set your intial date, set your max date, loop round incrementing the
month by one using dateAdd
<cfscript>
startDate = createDate(2003, 03, 01);
endDate = now();
thisDate = startDate;
while (dateCompare(thisDate, endDate, "m") lt 1) {
writeoutput(MonthAsString(Month(thisDate)) & " " &
Year(thisDate) & "<br />");
thisDate = dateAdd("m", 1, thisDate); //Increment month
}
</cfscript>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- looping over dates? John Beynon
- Re: looping over dates? Massimo Foti
- Re: looping over dates? Joe Rinehart
- Re: looping over dates? Joe Rinehart
- RE: looping over dates? Tangorre, Michael
- Re: looping over dates? John Beynon
- Re: looping over dates? d.a.collie
- Re: looping over dates? John Beynon
- Re: looping over dates? Joe Rinehart