CAML Query Help - Display all PDF files with "TrimReference" In Null

Yanıt CAML Query Help - Display all PDF files with "TrimReference" In Null

  • 16 Temmuz 2012 Pazartesi 23:56
     
      Kod İçerir

    I am trying to build a CAML query to add to 'Content Structure and Reports' where users can check all PDF documents that do not have anything in the "TRIMReference" field.

    I have:

    <Where><AND><IsNull><FieldRef Name="TrimReference" /></IsNull><Eq><FieldRef Name="File_x0020_Type"/><Value Type="Text">pdf</Value></Eq></AND></Where>

    but it doesn't return anything.

    I know that the following works (i.e. returns everything with nothing in the TrimReference field) but I just can't seem to work out how to only return PDFs with nothing in the TrimReference field.

    <Where><IsNull><FieldRef Name="TrimReference" /></IsNull></Where>

    Any help would be hugely appreciated.

    Thanks

Tüm Yanıtlar

  • 17 Temmuz 2012 Salı 10:09
     
     Yanıt

    Hi,

    This should work by replacing 'AND' with 'And' (CAML is Case Sensitive!)

    NicoBzh

    • Yanıt Olarak İşaretleyen Instar 17 Temmuz 2012 Salı 20:36
    •  
  • 17 Temmuz 2012 Salı 20:37
     
     
    Thank you NicoBzh.  That worked - I did not realise that CAML was case sensitive!