<cfoutput>
        <cfloop index=x from=5 to=1 step=-1>
                #DateFormat(DateAdd('d',-x,Now()),"MM/DD/YYYY")#<br>
        </cfloop>
</cfoutput> 

-----Original Message-----
From: Orlini, Robert [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 02, 2007 10:08 AM
To: CF-Talk
Subject: 5 days behind

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>

Thank you.

Robert
HWW




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:265471
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to