Never mind.  As soon as I hit send, I remembered ol' faithful
PreserveSingleQuotes.  Seems I forget this at least once per year.
Phew, good to get it out of the way for 2005.

Chad

-----Original Message-----
From: Chad [mailto:[EMAIL PROTECTED] 
Sent: Monday, 17 January 2005 7:53 AM
To: 'CFAussie Mailing List'
Subject: What's wrong with this query?


Hey all, Happy Mondays.

This thing's frustrating the heck out of me.  

<!--- Loop through the user's positions --->
<cfloop query="PositionQuery">
        <cfset indexWhere = indexProjectsWhere & " OR
(ProjectTable.EmployeeID=0 AND (ProjectTable.HRPositionID=" &
#HRPositionID# & " AND ProjectTable.Status<>'closed2'))">
</cfloop>

and here's the SQL from the query:
SELECT ProjectTable.ProjectID, ProjectTable.ProjectTypeID,
ProjectTable.ProjectName, ProjectTable.EmployeeID,
ProjectTable.HRPositionID, ProjectTable.Status,
ProjectTypeTable.ProjectType
        FROM ProjectTable RIGHT JOIN ProjectTypeTable ON
ProjectTable.ProjectTypeID = ProjectTypeTable.ProjectTypeID
        WHERE (ProjectTable.EmployeeID=#EmployeeSession# AND
ProjectTable.Status<>'closed1')#indexProjectsWhere#
        ORDER BY ProjectTable.ProjectName

I'm getting: "Incorrect syntax near 'closed2'."

Yet if I output the raw sql, it runs fine in Access.  And if I paste the
output of indexProjectsWhere it works fine.  Some problem when going
from the variable to the sql.

Any ideas?

thx.

Chad


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to