Try some like this.. dont think you have specify "INNER".. its understood.
IF the Column Names are "NAME" or "COST".. try alias them like below

<cfquery name="get_ab" datasource="MyDSN">
        SELECT 'GName'=A.Name, 'GCost'=B.Cost
       FROM tableA A JOIN tableB B ON A.ID = B.AID WHERE B.AID = 1
</cfquery>

Type IV driver doesnt seem to like something.

Joe
Certified Advanced ColdFusion Developer
[EMAIL PROTECTED]

-----Original Message-----
From: Ye Wang [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 1:54 PM
To: CF-Talk
Subject: CFMX & SQL - simple query with weird error message


We just installed CFMX on a brand new server, W2k with SQL 2000. Most
CF5 codes worked and no problems with stored procedures so far, except a
few errors on simple queries. One of them was quite weird.

Name : VARCHAR(128)
Cost: real
tableA joins tableB on (tableA.ID = tableB.aID)

Case 1: works
    <cfquery name="get_a" datasource="myDSN">
        SELECT ID, Name
        FROM tableA
    </cfquery>

Case 2: works
    <cfquery name="get_b" datasource="myDSN">
        SELECT aID, Cost
        FROM tableB
        WHERE aID = 1
    </cfquery>

Case 3: NOT working in CFMX but in CF5 and old versions
    <cfquery name="get_ab" datasource="MyDSN">
        SELECT A.Name, B.Cost
       FROM tableA AS A INNER JOIN
                   tableB AS B ON (A.ID = B.aID)
        WHERE B.aID = 1
    </cfquery>

CFMX Error message:



  Error Executing Database Query.

    [Macromedia][SQLServer JDBC Driver]Value can not be converted     to
requested type.

Now Case 3 is too simple to cause errors. If CFMX can handle more
complicated queries and stored procedures but not this one, it's just
hard to understand. Maybe something too simple?! I've tried many things
but cannot fix it. Can anyone throw some light on this? Thx

-Ye


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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