I want to pass a string(date) in a caml query to get listitem based on datetime type of field. I am not getting any value in return. Please suggest. Below is my code:
` private SP.ListItem FindListItem(List selectedList, Field field, string value, ClientContext clientContext)
{
SP.ListItem listItem = null;
CamlQuery camlQuery = new CamlQuery();
if (field.TypeAsString == "DateTime")
{
DateTime datevalue = Convert.ToDateTime(value);
camlQuery.ViewXml = @"<View><Query><Where><Eq><FieldRef Name=" + field.InternalName + @"/><Value Type=" + field.TypeAsString + @">" + datevalue + @"</Value></Eq></Where></Query></View>";
SP.ListItemCollection items = selectedList.GetItems(camlQuery);
clientContext.Load<SP.ListItemCollection>(items);
clientContext.ExecuteQuery();
if (items.Count > 0)
listItem = items[0];
return listItem;
}`