I am trying to sort the custom meta results based on key_date_value field. when i add the sort parameter the query is returning no result but is working fine if i remove the sort filter. The code is as below
int month = 5;
var v = DateTime.Now.AddMonths(-month);
CustomMetaValueCriteria metaValueCriteria=new CustomMetaValueCriteria(v,Criteria.LessThanOrEqual);
CustomMetaKeyCriteria metaValue = new CustomMetaKeyCriteria("ArticleDate", Criteria.Equal);
PublicationCriteria pubCriteria=new PublicationCriteria(80);
Criteria[] final = { metaValueCriteria, metaValue, pubCriteria };
Query query = new Query(CriteriaFactory.And(final));
CustomMetaKeyColumn customMetaKeyColumnDate = new CustomMetaKeyColumn("KEY_DATE_VALUE", MetadataType.DATE);
SortParameter sortParameter = new SortParameter(customMetaKeyColumnDate, SortParameter.Descending);
query.AddSorting(sortParameter);
var k = query.ExecuteEntityQuery();
Thanks, Rajendra