<select name="days2">
<cfloop from="#dateAdd('d',-5,now())#" to="#now()#" index="i" >
<option><cfoutput>#dateformat(i,"mm/dd/yyyy")#</cfoutput></option>
</cfloop>
</select>
On 1/2/07, Jim Wright <[EMAIL PROTECTED]> wrote:
>
> Orlini, Robert wrote:
> > I have an interesting dilemma.
> >
> > I need to populate a Select dropdown field with the past five days.
> > It worked OK until today and it's my coding fault. Right now it is
> > trying to retrieve days 28 to 01 which are none. See loop below.
> >
> > How do I have it recognize dates as opposed to numbers for the day? I
> > need it to display days 12/28/2006 to 01/02/2007.
> >
> > <cfset fivedaysbehind= #dateformat(now()-5,"dd")#> (This is 28)
> > <cfset day = #dateformat(now()-1,"dd")#> (This is 01)
> >
> > <cfloop index="i" from="#day#" to="#fivedaysbehind#"> #i#<br> (This
> > dropdown is blank now) </cfloop> </cfoutput>
> >
>
> How about...
>
> <cfloop index="i" from="1" to="5">
> #dateformat(now()-i,"dd")#<br>
> </cfloop>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265473
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4