<cfoutput>#DateFormat(Now()-7,"yyyy/mm/dd")# - #qTmp.DateTime#</cfoutput>
dateAdd() needs to be in there for the -7 thing to work.
here is the below in correct format.
<cfquery name="lQuery2" dbtype="query">
SELECT UserName, SearchString, Count(SearchString) AS Occurences
FROM qTmp
WHERE '#dateFormat(dateAdd('d',Now(),-7),'mm/dd/yyyy')#' <
'#dateFormat(dateTime,'mm/dd/yyyy')#'
GROUP BY UserName, SearchString
</cfquery>
hth
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-----Original Message-----
From: ColdFusion Programmer [mailto:[EMAIL PROTECTED]
Sent: Friday, October 10, 2003 11:59 AM
To: CF-Talk
Subject: Re:SQL Statement help!
I've tried this and it errors:
<cfoutput>#DateFormat(Now()-7,"yyyy/mm/dd")# - #qTmp.DateTime#</cfoutput>
<cfquery name="lQuery2" dbtype="query">
SELECT UserName, SearchString, Count(SearchString) AS Occurences
FROM qTmp
WHERE <cfqueryparam cfsqltype="cf_sql_timestamp"
value="#DateFormat(Now()-7,'yyyy/mm/dd')#"> < DateTime
GROUP BY UserName, SearchString
</cfquery>
>ok so format that value, with dateFormat, enclose it in 's and you
>should be good.
>
>...tony
>
>tony weeg
>senior web applications architect
>navtrak, inc.
>www.navtrak.net
>[EMAIL PROTECTED]
>410.548.2337
>
>-----Original Message-----
>From: ColdFusion Programmer [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 10, 2003 10:31 AM
>To: CF-Talk
>Subject: Re:SQL Statement help!
>
>I think this is what you mean
>DateTime - 2003/09/01 11:52:16
>Now - {ts '2003-10-10 15:28:19'}
>
>>whats the value of dateTime parse out to?
>>
>>
>>...tony
>>
>>tony weeg
>>senior web applications architect
>>navtrak, inc.
>>www.navtrak.net
>>[EMAIL PROTECTED]
>>410.548.2337
>>
>>-----Original Message-----
>>From: ColdFusion Programmer [mailto:[EMAIL PROTECTED]
>>Sent: Friday, October 10, 2003 9:32 AM
>>To: CF-Talk
>>Subject: Re:SQL Statement help!
>>
>>I now get a different error
>>
>>Query Of Queries runtime error.
>>Unsupported type comparison.
>>
>>>ColdFusion Programmer wrote:
>>>> Guys, I'm sorry for so many errors on my part. Jochem, the code
>>>> your posted throws an error,
>>>>
>>>> Error Executing Database Query.
>>>>
>>>> Query Of Queries syntax error.
>>>> Encountered "{" at line 0, column 0. Incorrect conditional
>>>> _expression_, Expected one of [like|null|between|in|comparison]
>>>> condition,
>>>
>>>SELECT UserName,
>>> SearchString,
>>> Count(SearchString) AS Occurences
>>>FROM qTmp
>>>WHERE <cfqueryparam cfsqltype="cf_sql_timestamp"
>>>value="#DateAdd("d",-7,Now())#"> < DateTime GROUP BY UserName,
>>> SearchString
>>>
>>>Jochem
>>>
>>>
>>>
>>>
>>________________________________
>>
>>
>________________________________
>
>
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

