SharePoint - Get the year Value only on DATETIME FieldType, using CAML

Asked By jc dls on 25-Mar-13 06:34 AM

I am building Dynamic CAML query like this in my visual webpart..

FieldValue is a dropdownlist with year options. And my PublishedDate is returning DATEWITHTIME. So it is not match. What can i replace with my comparison operators to satisfy this condition. I used CONTAINS but it is not returning any result. is this resolvable?


lstOfElement.Add(new CamlQueryElements
{
ComparisonOperators = "Contains",
FieldName = "PublishedDate",
FieldType = "DateTime",
FieldValue = ddlYear.SelectedValue.ToString(),
LogicalJoin = "And"
});