On Tue, Mar 11, 2008 at 12:37 PM, Che Vilnonis <[EMAIL PROTECTED]> wrote:
> How can I compare dates in a QofQ date comparison? See code snippet below.
> Thanks, Che
>
> <cfset threeMonthsAgo = dateformat(dateAdd("m", -3, now()), "m/d/yyyy")>
> <cfset dirArt = ExpandPath("../") & "emailblast">
>
> <cfdirectory
> action="LIST"
> directory="#dirArt#"
> name="getArt"
> filter="*.jpg">
>
> <cfquery name="filteredArt" dbtype="query">
> select name from getArt
> where type = 'file' and
> datelastmodified > <cfqueryparam value="#threeMonthsAgo#"
> cfsqltype="CF_SQL_DATE">
> </cfquery>
>
> <cfdump var="#filteredArt#">
couple of suggestions:
1) if something isn't working, explain what's not working about it :)
2) <cfset threeMonthsAgo = dateAdd('m', -3, now()) /> <-- no need for
dateFormat() there. only format a date if you're displaying it.
3) i don't believe there's any benefit to using cfqueryparam in a
query of queries. it's not like there's the possibility of SQL
injection, nor do i think there'd be any inherent performance
benefits.
--
Evelyn the dog, having undergone further modification pondered the
significance of short-person behaviour in pedal depressed,
pan-chromatic resonance, and other highly ambient domains. "Arf," she
said.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300995
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4