Hi,
I have what I thought would be a somewhat straight-forward query where I would find 
all the matching names from two tables.  In both there are two columns to separate the 
names into first and last...were there may be a MI along with the first name.  I'm 
trying to get the query to pick up a match whether there is a MI in either of the 
tables...but it doesn't seem to be working.  Here is the whole query.  I had it set up 
earlier such that it only had the first two conditions: match the badge or name (w/o 
MI)...that worked fine.  Now, even though I added the other two conditions, the query 
still comes up with the same number of records.  The record I'm checking for has the 
incorrect badge number (so it won't show up based on that) and the name is "Rose A" 
(first name) "Riggins" (last name).  There is a "Rose" (first name) "Riggins" (last 
name) in the other table.  Why doesn't the query pick up the match?  Thanks for all 
ideas!  (this has been bugging me for too long...) 
 
 
SELECT Vendor_Circuit_Number, Total_Employee_List.ISP_User_Last_Name, 
Total_Employee_List.ISP_User_First_Name, Valid_Employees.Last_Name, 
Valid_Employees.First_Name FROM Total_Employee_List INNER JOIN Valid_Employees ON 
(Total_Employee_List.ISP_Employee_Badge_Number=Valid_Employees.[Badge Number]) 
Or 
(trim(Total_Employee_List.ISP_User_First_Name)+trim(Total_Employee_List.ISP_User_Last_Name)=trim(Valid_Employees.First_Name)+trim(Valid_Employees.Last_Name))
OR
(
(trim(Total_Employee_List.ISP_User_First_Name)+" %") LIKE 
trim(Valid_Employees.First_Name) AND
trim(Total_Employee_List.ISP_User_Last_Name) = trim(Valid_Employees.Last_Name)
)
OR 
(
trim(Total_Employee_List.ISP_User_First_Name) LIKE (trim(Valid_Employees.First_Name)+" 
%") AND
trim(Total_Employee_List.ISP_User_Last_Name) = trim(Valid_Employees.Last_Name)
)
;
 
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to