查询的时候,一般只支持日期的比较,不支持时间的比较,需要在代码中加入

 如下:

Code

日期的格式必须写成”2008-8-6T10:00:00S“

 

对于动态的日期格式,要用SPUtility.CreateISO8601DateTimeFromSystemDateTime来转换


命名空间:Microsoft.SharePoint.Utilities


方法如下:

query.Query = "<Where>" +
                            
"<Gt>" +
                                
"<FieldRef Name=\"_x5f00__x59cb__x65f6__x95f4_\"></FieldRef>" +
                                
"<Value Type=\"Datetime\" IncludeTimeValue=\"TRUE\">" + SPUtility.CreateISO8601DateTimeFromSystemDateTime(zz_DateTimeControl1.SelectedDate).ToString()+"</Value>" +
                            
"</Gt>" +
                       
"</Where>";

 

 学习自:http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1313

 

posted on 2008-08-06 16:33  晃晃悠悠  阅读(569)  评论(0)    收藏  举报