"Date" is possibly(probably) a reserved word? Even if it isn't, your test
will fail when the year rolls over - you should test yyyy/mm/dd.  And I
think you might need apostrophes around today's formatted date?

None of this is guaranteed, I am famous for being wrong.


-----Original Message-----
From: Mark Lewis [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 30, 2007 7:43 AM
To: CF-Talk
Subject: Query of Queries date comparison

Hi,

Wondered if someone could advise on this problem I am having.

I have created a query as shown below...


<cfset event = QueryNew("date, name, destination", "date, varchar,
varchar")>

<cfset newRow = QueryAddRow(event, 2)>

<cfset temp = QuerySetCell(event, "date", 07/28/2007, 1)>
<cfset temp = QuerySetCell(event, "name", "trip to zoo", 1)>
<cfset temp = QuerySetCell(event, "destination", "london", 1)>

<cfset temp = QuerySetCell(event, "date", 07/31/2007, 2)>
<cfset temp = QuerySetCell(event, "name", "trip to zoo", 2)>
<cfset temp = QuerySetCell(event, "destination", "london", 2)>


I would like to run a query on this query where it finds only the records
where the date is greater than today.

I have written the following...

  <cfquery name="search" dbtype="query">
   SELECT *
   FROM event
   WHERE date > #DateFormat(Now(),"mm/dd/yyyy")#
  </cfquery>

However I get an error returned 

"Query Of Queries syntax error.
Encountered "date. Incorrect conditional expression, Expected one of
[like|null|between|in|comparison] condition, "

Does this mean I cannot use this greater than ( > ) clause on a query of
queries, I have searched for some documentation but couldnt find any. I f
anyone knows where any could be posted on the web, or a solution to this
problem that would be great.

Thank you in advance

Mark



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284787
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to