<cfquery name="GetKeyUser" datasource="lsar_dev">
        select  fullname, role
        from    dbo.tbl_users
        where   role = (select 'key_' + '' + role as keyrole
                                from dbo.tbl_users
                                where username = '#session.username#')

-----Original Message-----
From: James Taavon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:37 PM
To: CF-Talk
Subject: Access to SQL discrepancy in transfer of data


What a surprise, NOT!!


I have a QUERY in a QUERY that works fine in MS-Access 97, but bombs in SQL
SERVER 2000.

Here is the query:

<cfquery name="GetKeyUser" datasource="lsar_dev">
        select  fullname, role
        from    dbo.tbl_users
        where   role = (select 'key_' & role as keyrole
                                from dbo.tbl_users
                                where username = '#session.username#')
</cfquery>


The error:

ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid operator for data
type. Operator equals boolean AND, type equals nvarchar.


SQL CHANGED MY DATA TYPES FROM TEXT IN ACCESS TO NVARCHAR IN SQL. WHAT
DATATYPE SHOULD THE FIELD "ROLE" BE?


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to