Sure, just prepend the database name before the table name, so you'll have this:
select ... from placements where ... (select ... from users.USERS ...) .... > -----Original Message----- > From: Matthew Friedman [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 29, 2003 11:55 AM > To: CF-Talk > Subject: SQL Query - Can you do this > > > I have a question and I am not sure if you can do this. > > I need to do a query join information from two separate tables in > different > database. > > Both databases are on the same SQL server and registered in CF. > > > what I am trying to do is the follows > > > <CFQUERY NAME="placed_jobs" DATASOURCE="placments"> > select > media_cost,transaction_fee,post_type,Job_Ref,company_id,Purchased_ > for,Positi > on_Title,PO_number,Date_placed,company_Contact,tranaction > from placements > where company_id in (select id from USERS where referral_is = > <cfqueryparam > cfsqltype="CF_SQL_INTEGER" value="#session.referral_id#">) > order by Date_placed,company_id > </CFQUERY> > > > the issue is that the USERS table is in the database users. > > Any help would be great. > > Matthew Friedman > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

