Hi, I use to be a bit of a wiz at coldfusion 4, but I havent used it in quite a WHILE! Now its at version 7 and what I remember doesnt seem to work anymore... I am trying to write a 'news' page, it takes data from two tables... news and users. It will display the title and story from the news table and the username from the users table. The two tables will be joined by the userid which is the same in both tables.... Here is my query, that use to work in old version 4! <cfquery datasource=#db# name=test> SELECT * FROM news, users WHERE news.userid = users.userid </cfquery> Code (markup): But it just comes up with this error: Any help would be greatly appreciated, and once I have got over this rather easy milestone, I will be able to get on with it! Thanks, William
Hello William - this doesn't have to do with you question but try to use joins. Also, are you sure you want to use ALL of the fields from BOTH tables? Just a question. I would rewrite the query this way: <cfquery datasource=#db# name=test> SELECT news.*, users.* FROM news inner join users on news.userid = users.userid </cfquery> Now - back to your question - it is quite possible that based on the error given that the two fields are indeed not the same data type - check your table definition to confirm. If so, either change them to the same type or adjust your query so that it can handle the two types Hope this helps
datropics - you are a legend, the userid field in the users table was an autonumber and userid in news was text. changed it to number and its sorted... and yes, i will change the query to only select from the columns that i need. cheers william