One thing to note is that DateDiff from your cfquery is a database
function and DateDiff from your cfif is a ColdFusion function and they
might be returning different information. Try cfdumping this query and
see what the result is:
SELECT *, DateDiff('d',#DaNow#,EndDate) AS databaseDateDiffDiference FROM adVerts WHERE (DateDiff('d',#DaNow#,EndDate) >=0) AND (AdType = 'BigBox')
WHERE (DateDiff('d',#DaNow#,EndDate) >=0) AND (AdType = 'BigBox')
I have three records that come back as -1, 220, 150.
It may be that your date variable is not enclosed in quotes. So your database is not treating it as a date string (ie "06/12/2009"), but is instead interpreting it as a numeric representation of date: "06/12/2009" -> 06 divided by 12 divided by 2009 . That produces completely a different date.
But I would suggest using cfqueryparam to pass in a proper date object, rather than a string. I would also restructure the query to get rid of the DateDiff statement. A simple comparison operator should do the job, and should yield better performance than DateDiff. Plus it is more intuitive IMO. Though techically, either option would work.
<!--- something along these lines --->
WHERE AdType = 'BigBox'
AND EndDate >= <cfqueryparam value="#now()#" cfsqltype="cf_sql_date">