Alright, I just made a UDF for that /me loves udf's :)

This will output the list of dates in a list.

<cfoutput>#dateRange("02/02/02","02/10/02")#</cfoutput>

<cfscript>
function dateRange(sDate, eDate){
nDate = sDate;
dateList = "";

while(datediff("d",eDate,nDate) NEQ 0) {
        nDate = dateAdd("d",1,nDate);
        dateList = listAppend(dateList, nDate);
        }
Return dateList;
}
</cfscript>


______________________
steve oliver
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Steve Oliver [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 31, 2002 9:17 PM
To: CF-Talk
Subject: RE: Help with a list of dates


You could do something like this

<cfscript>
dateList = "";

sDate = startdate;
eDate = enddate;

while (datediff("d",sDate,eDate) NEQ 0) {
listAppend(dateList, dateAdd("d",1,sDate));
}
</cfscript>

Or something along that line



______________________
steve oliver
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 31, 2002 9:04 PM
To: CF-Talk
Subject: Help with a list of dates


Alright heres my problem:

I have two dates: 
Startdate: 1/12/02 
Enddate: 1/15/02

How do I use cf to build a list of dates from the startdate to the
endate like i.e. (1/12/02,1/13/02,1/14/02,1/15/02).

Does anybody have any resources or code snippets that might shed some
light on this.

Thanks
Jason

Thanks,
Jason Larson
[EMAIL PROTECTED]

"You think the Cubs have sore arms? What about the fans in left field?" 
 
 




______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to