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.