Question : Append LDAP Query

I need to add a query for an additional emai search I have tried to copy and paste multiple ways and all come up no quiry. I need to retain everything else and just add this.
(&(objectCategory=contact)(mail=*hrcwest.com))
Code Snippet:
1:
(&(&(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(msExchHomeServerName=/o=NRT/ou=Southern California/cn=Configuration/cn=Servers/cn=SCM*))(&(&(&(& (mailnickname=*) (| (objectCategory=group) )))(objectCategory=group)(mailNickname=sc*)))(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=contact)) )))(objectCategory=contact)(mail=*nrt*.com)))(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) )))(objectCategory=user)(extensionAttribute5=staff*)))(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) )))(objectCategory=user)(title=BRANCH*)))(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=contact)) )))(objectCategory=contact)(company=NRT-SoCal*))) )))))))

Answer : Append LDAP Query

if you need and AND relation ship do:

(& (&(objectCategory=contact)(mail=*hrcwest.com)) (&....original from 1st line of code...)    )

if you need a more intelligent answer.. because you might need to merge it somewhere in the middle i'm afraid I cant help...
it might be an idea to write out the complex current query and try to restructure it...  there seems to be quite a lot of duplicate items to be tested & queried.  
(Please lookup karnau diagram & boolean algebra).  It might make quite a difference in speed.
Random Solutions  
 
programming4us programming4us