Sounds like you are retrieving data and then filtering on the client with CF
based date math. And if so, then the best advice I can give you is don't.
This is the type of thing you need to do at the database level (in a SELECT
statement or a view or a stored procedure etc.). DBMSs are really good at
this type of date calculation, and you could easily create calculated fields
with all of the expiration values calculated automatically, and then you
just SELECT the ones with expired dates.

--- Ben



-----Original Message-----
From: Greg Morphis [mailto:gmorp...@gmail.com] 
Sent: Monday, January 24, 2011 1:20 PM
To: cf-talk
Subject: Re: Coldfusion8: Multiple checks within a CFIF for a valid date


Sure, you could add the names to check to a list I used this to check for
required form fields...

You can modify it for your needs

<cfset notRequired =
"sec_level,address2,division,phone_ext,fax_area,fax_prefix,fax_suffix,email_
directory,fieldnames"/>

<!--- loop over form fields checking for required fields ---> <cfloop
collection="#form#" item="key">
        <cfif not ListFindNoCase(notRequired, key)>
                <cfif len(trim(form[key])) eq 0>
                        <cfset errText = errText & "<div
class='alert'>**<cfoutput>#key#</cfoutput> is required**</div>">
                        <cfset hasErrors = 1 />
                </cfif>
        </cfif>
</cfloop>

On Mon, Jan 24, 2011 at 12:04 PM, Adam Bourg <adam.bo...@gmail.com> wrote:
>
>>yeah you can't do that.. gotta do
>>if adultExp gt 60 OR kidExp gt 60 OR ...
>>
>>
>>>
>
> Is there an easier way to do that? Maybe a loop?
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341141
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to