That and the indexing made it work sweet...nice combo. Thanks again, all. eric
-------------------------------------------------------- Eric J. Hoffman Managing Partner 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4105 fax: 651.717.4115 mob: 651.245.2717 -------------------------------------------------------- This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not [email protected] you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Eric J. Hoffman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -------------------------------------------------------- -----Original Message----- From: Jim Wright [mailto:[EMAIL PROTECTED] Sent: Monday, February 27, 2006 12:15 PM To: CF-Talk Subject: Re: SQL Exists, better way to run query? It seems like your logic is going to return every record from the customer table if a match is found in the customer_orders table. You need to tie the customer id from each of the tables together...something like.... EXISTS (Select cust_po from customer_orders where cust_po = '#form.po#' AND customerid = cu.customerid) -- Jim Wright Wright Business Solutions [EMAIL PROTECTED] 919-417-2257 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233567 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

