zoukankan      html  css  js  c++  java
  • 查询一周内的CAML语句

    public static string GetWeekCaml()
            {
               
                int weeknow = Convert.ToInt32(System.DateTime.Now.DayOfWeek);
                int daydiff = (-1) * weeknow;
                int dayadd = 6 - weeknow;
                DateTime dateBegin = System.DateTime.Now.AddDays(daydiff);
                DateTime dateEnd = System.DateTime.Now.AddDays(dayadd);
                string strDateBegin = SPUtility.CreateISO8601DateTimeFromSystemDateTime(dateBegin);
                string strDateEnd = SPUtility.CreateISO8601DateTimeFromSystemDateTime(dateEnd);

                string caml = @"<Where>
                                 <And>
                                  <Geq>
                                    <FieldRef Name='Created' /><Value Type='DateTime'>{0}</Value>
                                  </Geq>
                                   <Leq>
                                    <FieldRef Name='Created' /><Value Type='DateTime'>{1}</Value>
                                  </Leq>
                                 </And>
                              </Where>";
                caml = string.Format(caml,strDateBegin,strDateEnd);
                return caml;
            }   

  • 相关阅读:
    【linux】驱动-5-驱动框架分层分离&实战
    【linux】驱动-4-LED芯片手册分析
    【MCU】国民N32固件库移植
    【MCU】移植AT32库&FreeRTOS教程
    P3768 简单的数学题
    P4301 [CQOI2013] 新Nim游戏
    P4767 [IOI2000]邮局
    P3211 [HNOI2011]XOR和路径
    FWT 笔记
    P3175 [HAOI2015]按位或(max-min 容斥)
  • 原文地址:https://www.cnblogs.com/hqbird/p/2044302.html
Copyright © 2011-2022 走看看