Caml语句-Query写法

1.Geq(>=)
  The Geq element is an arithmetic operator that means "greater than or equal to." It can be used within a Where element in a view definition.
<Query>
  <Where>
    <Or>
      <IsNull>
        <FieldRef Name="Expires" />
      </IsNull>
      <Geq>
        <FieldRef Name="Expires" />
        <Value Type="DateTime">
          <Today />
        </Value>
      </Geq>
    </Or>
   </Where>
   <OrderBy>
   <FieldRef Name="Modified" Ascending="FALSE" />
  </OrderBy>
</Query>
2.Eq(=)
  The Eq element is an arithmetic operator that means "equal to" and is used within the Query element.
<Query>
  <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
  </OrderBy>
  <Where>
    <Or>
      <Eq>
        <FieldRef Name="Status"></FieldRef>
        <Value Type="Text">Completed</Value>
      </Eq>
      <IsNull>
        <FieldRef Name="Status"></FieldRef>
      </IsNull>
    </Or>
  </Where>
</Query>
3.Gt(>)
The Gt element is an arithmetic operator that means "greater than." This element is used similarly to Eq and Lt.
<Query>
  <Where>
    <Or>
      <IsNull>
        <FieldRef Name="Deadline" />
      </IsNull>
      <Gt>
        <FieldRef Name="Deadline" />
        <Value Type="DateTime">
          <Today />
        </Value>
      </Gt>
    </Or>
  </Where>
  <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE" />
  </OrderBy>
</Query>
4.Lt(<)
The Lt element is an arithmetic operator that means "less than" and is used in queries in views. This element is used similarly to Eq and Gt.
<Query>
  <Where>
    <Or>
      <IsNull>
        <FieldRef Name="Deadline" />
      </IsNull>
      <Lt>
        <FieldRef Name="Deadline" />
        <Value Type="DateTime">
          <Today />
        </Value>
      </Lt>
    </Or>
  </Where>
  <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE" />
  </OrderBy>
</Query>
5.Neq(!=)
The Neq element is an arithmetic operator that means "not equal to" and is used in queries.
<Query>
  <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
  </OrderBy>
  <Where>
    <Or>
      <Neq>
        <FieldRef Name="Status"></FieldRef>
        <Value Type="Text">Completed</Value>
      </Neq>
      <IsNull>
        <FieldRef Name="Status"></FieldRef>
      </IsNull>
     </Or>
   </Where>
</Query>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值