• 查询一周内的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;
            }   

  • 相关阅读:
    32 renren-fast-vue安装报错问题
    31 element自定义图片上传
    30 图片预览
    29 element-table样式更改
    28 ant-design-vue-jeecg运行报错问题
    27 mysql8安装
    25 mybatis-plus常用语法
    24 element表单校验
    23 鼠标移入移出更换样式
    22 初识mysql外键
  • 原文地址:https://www.cnblogs.com/hqbird/p/2044302.html
Copyright © 2020-2023  润新知