I want to retrieve all records based on recent similar createdon date. It is showing following exception.
The date-time format for createdon is invalid, or value is outside the supported range
Query:
var d1 = Convert.ToDateTime(subaction["startdate"]);
var d2 = Convert.ToDateTime(subaction["approvedenddate"]);
string FetchXML = "<fetch>" +
" <entity name=\"sales\" >" +
" <attribute name=\"rate\" />" +
" <filter type=\"and\">" +
" <condition attribute=\"date\" operator=\"between\" descending=\"true\" >" +
" <value> " + d1.ToString("MM/dd/yyyy") + " </value>" +
" <value> " + d2.ToString("MM/dd/yyyy") + " </value>" +
" </condition>" +
" <condition attribute=\"createdon\" operator=\"eq\" value=\"createdon\" >" +
" </condition>" +
" <condition attribute=\"ford_approved\" operator=\"eq\" value=\"1\" />" +
" </filter>" +
" <order attribute=\"createdon\" descending=\"true\" />" +
" </entity>" +
" </fetch>";
Please help me with this issue.
*This post is locked for comments