1

I am getting a query from list view by view.Query i got the following

<QUERY><GroupBy Collapse="TRUE" GroupLimit="100"><FieldRef Name="AlertGrp" /></GroupBy>       <OrderBy><FieldRef Name="PriorityNoLink" Ascending="FALSE" /><FieldRef Name="match_time"   Ascending="FALSE" /></OrderBy><Where><And><And><And>
<Neq><FieldRef Name="Category" /><Value Type="Text">ACH Alert</Value></Neq>
<Neq><FieldRef Name="Category" /><Value Type="Text">Check Fraud</Value></Neq>
</And>
<IsNull><FieldRef Name="Close_x0020_Reason" /></IsNull></And>
<Eq><FieldRef Name="AlertType" /><Value Type="Text">Alert</Value></Eq>
</And>
</Where></QUERY>

I want to add one more condition something like

<Geq><FieldRef Name="Created" /><Value Type="DateTime"><Today OffsetDays="-5" />    </Value></Geq>

I added after AlertType

<Eq><FieldRef Name="AlertType" /><Value Type="Text">Alert</Value></Eq>
</And>

and start tag < And> added in the beginning along with "< And>< And>< And>"

But showing wrong result. Kindly help me where i can add the new condition.

regards jhanani

user2518802
  • 21
  • 1
  • 7
  • By the way, you can use "[CAML Builder][1]" to construct your CAML query :-) [1]: http://sharepoint.stackexchange.com/questions/72164/where-can-i-download-the-u2u-caml-query-builder-for-sharepoint-2010/72165#72165 – AymKdn Jul 31 '13 at 18:22
  • After upgrade my version now am able to get the correct lis view query.Now pls tell me where to add New condition And>Check FraudAlert – user2518802 Aug 05 '13 at 11:22
  • Use Caml Builder to build your CAML syntax (see my previous comment) – AymKdn Aug 05 '13 at 14:19

1 Answers1

1

All your filters will be AND?

Try This:

<Where>
  <And>
    <And>
      <And>
        <And>
          <Neq>
            <FieldRef Name="Category" />
            <Value Type="Text">ACH Alert</Value>
          </Neq>
          <Neq>
            <FieldRef Name="Category" />
            <Value Type="Text">Check Fraud</Value>
          </Neq>
        </And>
        <IsNull>
          <FieldRef Name="Close_x0020_Reason" />
        </IsNull>
      </And>
      <Geq>
        <FieldRef Name="Created" />
        <Value Type="DateTime"><Today OffsetDays="-5" />
        </Value>
      </Geq>
    </And>
    <Eq>
      <FieldRef Name="AlertType" />
      <Value Type="Text">Alert</Value>
    </Eq>
  </And>
</Where>
Tiago
  • 2,156
  • 2
  • 18
  • 27