Put hashes(pound signs) around your variables: Day(Status.EffectiveDate) = #variables.newDay# and
without them the SQL reads as is e.g. a table named variables with a column named newDay. Ade -----Original Message----- From: Graham Pearson [mailto:[EMAIL PROTECTED] Sent: 06 March 2005 22:14 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? -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.6.2 - Release Date: 04/03/2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197623 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

