Ok that's just way too simple :) Thanks Greg! Sometimes my brain makes things more complicated than they need to be.
Bob -----Original Message----- From: Greg Morphis [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 11:19 AM To: CF-Newbie Subject: Re: checking to see if date has passed Try this <cfset foodate = createdate(2008, 4, 1) /> <cfif foodate lt now()> This is in the past <cfelse> This is not in the past </cfif> On Tue, Jun 10, 2008 at 10:09 AM, Imperial, Robert <[EMAIL PROTECTED]> wrote: > Hi folks, > > > > I realize this is probably elementary for most of you but I'm not seeing > the solution I need for this. I have 2 dates being passed from a form in > this format 07/10/2008 and I am trying to check to see if these dates > have passed today's date in Coldfusion. Not having much success with it > at this point and any help would be greatly appreciated. I have tried > the following by stripping out everything that's not numeric, but of > course that won't work, but it was a nice exercise in using replace J > TIA > > > > <cfset ThisDate = now()> > > <cfset TheDate = DateFormat(ThisDate, 'mm/dd/yyyy') /> > > <cfset justThisNumber = rereplace(TheDate,"[^[:digit:]]*","","all")> > > > > <cfset justThatNumber = > rereplace(form.fromDate,"[^[:digit:]]*","","all")> > > > > <cfset justTheOtherNumber = > rereplace(form.toDate,"[^[:digit:]]*","","all")> > > > > <cfif justThatNumber LT justThisNumber OR justTheOtherNumber LT > justThisNumber> > > <script> > > alert("The from or to date you entered has already passed, > please enter a new date."); > > history.back(); > > </script> > > <cfelse> > > > > Bob > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3742 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
