0

I'm trying to limit the results using more than one WHERE clause like it is done in .net such as

search.Filter = ("(&(objectCategory=person)(physicaldeliveryofficename=*))

but in SQL with open query on linked server I have this and works fine with only one where clause.

SELECT Name, Department, Title, Telephonenumber Phone, physicaldeliveryofficename Location FROM OPENQUERY( ADSI, 'SELECT Name, Department, Title, Telephonenumber, physicaldeliveryofficename, SN, ST FROM ''LDAP://OU=XM,DC=nix,DC=com'' WHERE physicaldeliveryofficename= ''*'' ')

Is it even possible to have more than one WHERE clause? Thanks in advance for any assistance.

Jorge
  • 13
  • 3

1 Answers1

0

More than one WHERE clause? Or you just want to put the filters together with "AND"?

WHERE 
    physicaldeliveryofficename= "*" AND
    objectCategory="person"
baldpate
  • 1,707
  • 1
  • 14
  • 23
  • I figured it out in SQL openquery it doesn't like double quotes(" ") instead I used single (' ' ' ') and it worked perfectly. And yes baldpate I was trying to but more filters together. – Jorge Nov 24 '14 at 15:14