Did you try 'YYYY-MM-DD'?

<cfquery name="filteredArt" dbtype="query">
select  name from getArt
where   type = 'file' and
               datelastmodified > '#dateFormat(threeMonthsAgo,
"YYYY-MM-DD")#'
</cfquery>

On Tue, Mar 11, 2008 at 3:54 PM, Che Vilnonis <[EMAIL PROTECTED]> wrote:

> Point #1. True. I guess I thought it was obvious.
> Points #2&3... I've tried that. I get the following...
>
> Error Executing Database Query.
> <br><b>Query Of Queries syntax error.</b><br> Encountered "2007" at line
> 0,
> column 0.
>
> -----Original Message-----
> 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.
>
>
> 

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

Reply via email to