What results do you get if you remove the first part of the WHERE clause 
and just use the part in the parentheses?  I've never tried to use an OR 
clause as part of an inner join, so I'd probably play around with it by 
splitting it into two SELECT queries that are merged by a UNION clause and 
see if that works:

SELECT CH_Employee_ATT_feb.ISP_User_Last_Name, 
CH_Employee_ATT_feb.ISP_User_First_Name, 
CH_Employee_ATT_feb.ATT_Usage_feb.Invalid_User, Valid_Employees.Last_Name, 
Valid_Employees.First_Name 
FROM CH_Employee_ATT_feb, Valid_Employees
WHERE CH_Employee_ATT_feb.ISP_User_Last_Name = Valid_Employees.Last_Name 
AND CH_Employee_ATT_feb.ISP_User_First_Name = Valid_Employees.First_Name
UNION
SELECT CH_Employee_ATT_feb.ISP_User_Last_Name, 
CH_Employee_ATT_feb.ISP_User_First_Name, 
CH_Employee_ATT_feb.ATT_Usage_feb.Invalid_User, Valid_Employees.Last_Name, 
Valid_Employees.First_Name 
FROM CH_Employee_ATT_feb, Valid_Employees
WHERE CH_Employee_ATT_feb.ISP_Employee_Badge_Number = 
Valid_Employees.[Badge Number]

You can also try rewriting the join using ANSI-style syntax.  Even though 
it doesn't really make a difference in what gets executed, sometimes that 
causes you to see the query in a different way that points out logic 
flaws.

Thanks,
Eric





"Conaway, Amy C" <[EMAIL PROTECTED]>
08/05/2003 10:50 AM
Please respond to sql

 
        To:     SQL <[EMAIL PROTECTED]>
        cc: 
        Subject:        oops!


..it would help if I pasted the code....
 
SELECT CH_Employee_ATT_feb.ISP_User_Last_Name, 
CH_Employee_ATT_feb.ISP_User_First_Name, 
CH_Employee_ATT_feb.ATT_Usage_feb.Invalid_User, Valid_Employees.Last_Name, 
Valid_Employees.First_Name 
FROM CH_Employee_ATT_feb, Valid_Employees
WHERE CH_Employee_ATT_feb.ISP_Employee_Badge_Number = 
Valid_Employees.[Badge Number] OR (CH_Employee_ATT_feb.ISP_User_Last_Name 
= Valid_Employees.Last_Name AND CH_Employee_ATT_feb.ISP_User_First_Name = 
Valid_Employees.First_Name) ;
 
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                        

Reply via email to