Monday, May 15, 2006 9:45:39 PM UTC :: Filed Under VB.NET

Should you ever find yourself needing to write CAML queries (XML queries) against a SharePoint list, the U2U CAML tool is quite helpful. U2U member Patrick Tisseghem has a nice blog post on how to use the tool which can be downloaded form their web site.

One thing to note is that the tool wraps the query XML nodes within a <Query></Query> node.  You’ll want to delete that node in your .NET code.  As a result, your CAML query might look something like this: 

Dim strQueryDate as String = Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(CDate(“05/05/2006”))

Dim strQuery as String = “<Where><Geq><FieldRef Name=””Created”” /><Value Type=””DateTime””>{0}</Value></Geq></Where>”, strQueryDate)

Note the goofy CreateISO8601DateTimeFromSystemDateTime method that is used for the date… CAML uses an ISO8601 date format so you must use this method if you want to do date comparisons.

Comments are closed.
Navigation
On this page....
Search
Archives
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Categories
Contact me
Send mail to the author(s) Contact Todd M. Taylor