use  <CFQUERYPARAM value="#newMonth#" cfsqltype="cf_sql_integer" /> for both

-----Original Message-----
From: Graham Pearson [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 06, 2005 4:16 PM
To: CF-Talk
Subject: Query Problem


I am running into a problem which I have not ran into before. Below is 
my query

<cfset newMonth = #Month(DateAdd("n", 1, Now()))#>
<cfset newDay = #Day(DateAdd("n", 1, Now()))#>
<cfset newYear = #Year(DateAdd("n", 1, Now()))#>

<cfquery name="GetClosings" Datasource="#Application.Speck.Codb#">
   Select status.CorpNumber, status.UserID, status.EffectiveDate, 
status.ReportedDateTime,
              status.Closed, sites.name as CorpName
   From status, sites
   Where status.corpNumber = sites.id and
          Month(Status.EffectiveDate) = variables.newMonth and
          Day(Status.EffectiveDate) = variables.newDay and
         Year(status.effectiveDate) = variables.newYear and
          status.closed = 1
     Order by CorpName
 </cfquery>

When I run the query I get an error message which states:

Base table or view not found message from server: "Unknown table 
'variables' in where clause"

I have this same query in another place but instead of 
variables.newMonth I have #Month(Now())#, Day(Now()), and Year(Now()) 
which gives me the desired results for today. The above query is 
supposed to give me results for tomorrow when the current time is past 
11:59 AM which I am testing via a cfif just above this query in my page. 
Anyone have suggestions?

-- 
------------------------------------------------------------------------




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197621
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to