Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question
By the way, you can use "[CAML Builder][1]" to construct your CAML query :-) [1]: sharepoint.stackexchange.com/questions/72164/… – AymKdn Jul 31 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<And> condition <QUERY><Where>And><Neq><FieldRef Name="Category" /><Value Type="Lookup">Check Fraud</Value></Neq><And><And><IsNull><FieldRef Name="Assigned_x0020_To" /></IsNull><IsNull><FieldRef Name="Close_x0020_Reason" /></IsNull></And><Eq><FieldRef Name="AlertType" /><Value Type="Text">Alert</Value></Eq></And></And></Where></QUERY> – user2518802 Aug 5 at 11:22
Use Caml Builder to build your CAML syntax (see my previous comment) – AymKdn Aug 5 at 14:19

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>
share|improve this answer
Hi sorry for the late reply. just now i upgrade the site and got the exact query. Please let me know where can i addd one more condtion – user2518802 Aug 5 at 10:20
<QUERY><Where>And><Neq><FieldRef Name="Category" /><Value Type="Lookup">Check Fraud</Value></Neq><And><And><IsNull><FieldRef Name="Assigned_x0020_To" /></IsNull><IsNull><FieldRef Name="Close_x0020_Reason" /></IsNull></And><Eq><FieldRef Name="AlertType" /><Value Type="Text">Alert</Value></Eq></And></And></Where></QUERY> where to add new condition "<Geq> <FieldRef Name="Created" /> <Value Type="DateTime"><Today OffsetDays="-5" /> </Value> </Geq>" – user2518802 Aug 5 at 10:31
I got the correct query of list view now (after creating new site), kindly help me in the above query where to add Created codition – user2518802 Aug 5 at 10:36
your query would be this: <Where><And><And><And><And><Neq><FieldRef Name="Catego >Check Fraud</Value></Neq><IsNull><FieldRef Name="Assi </And><IsNull><FieldRef Name="Close_x0020_Reason" /></ Name="AlertType" /><Value Type="Text">Alert</Value></ me="Created" /><Value Type="DateTime"><Today OffsetDay nd></Where> – Tiago Aug 5 at 13:18
Thanks i will try – user2518802 Aug 6 at 5:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.