1.] Try this...

<cfparam name="startDate" default="#now()#">

<select name="KidDate">
<cfloop from="0" to="12" index="ii">
        
        <cfset tempDate = dateAdd('M',ii,startDate)>
        
        <cfoutput>
                <option value="#tempdate#">#dateFormat(tempDate,'MMMM
YYYY')#</option>                
        </cfoutput>
</cfloop>
</select>



2 & 3 .] Notice that start date is set with cfparam.  Using this way, you
can populate the variable beforehand 
anyway you want (database, user, session vars, etc...) 



-----Original Message-----
From: Paul Ihrig [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 9:36 AM
To: CF-Talk
Subject: Date Range


Ok 3 Questions... if you have some time.

1.] below i have a range in a select that shows Next month, 
Every month for a year.
Bt i cant seem to show this month. i have tried -1 in the DateAdd, but that
just makes the range count back wards.
have also tried removing the date add.

2.] Also If i wanted to show the range from ether
a starting date from a db, 

3.] OR from  a specified date such as
January 2001 how would i do these 2 things?


<CFSELECT name="KidDate">
<cfset StartMonthDate = #Now()#>

<cfloop index="ii" from="1" to="12">
<cfset StartMonthDate = DateAdd('M',1, StartMonthDate)>

<cfoutput>
<OPTION VALUE="#StartMonthDate#">
#DATEFORMAT(StartMonthDate,'MMMM YYYY')#
</OPTION>
</cfoutput>

</cfloop>
</CFSELECT><br>


Thank You
-paul

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to