16 September 2011 8:56
qry.Criteria.AddCondition("createdon", ConditionOperator.GreaterEqual, "15/09/2011");
The above query returns an error 'The date-time format for 15/09/2011 is invalid, or value is outside the supported range.'
What is the dateformat to be used in the condition expression(dd/mm/yyyy) or(mm/dd/yyyy)
System settings has dd/mm/yyyy format
User settings has dd/mm/yyyy format
Server is also set dd/mm/yyyy format
But still the above query throws the error.
16 September 2011 9:17Moderator
try to create datetime object with your data value and pass the same in criteria.
Mahain : MS CRM Freelancer
16 September 2011 9:23
I have an aspx page where the user will select a date from a calendar control. The user may be in any time zone.So if a user selects a date crm should fetch the records according to his timezone. So how will I pass the date in the criteria. Should it be the date as it is or should it be converted to utc and passed. How can we achieve this?
24 Juni 2012 9:35
When you assign a CRM attribute to a datetime value, CRM will take the value based on the datetime value's Kind property. If it's a local time, CRM will translate it into UTC time before saving to CRM database. If it's already an UTC time, then CRM will save it as it is.
More info in this thread: http://social.microsoft.com/Forums/en/crmdevelopment/thread/0f0e4e97-c97a-4bc9-af4a-a5f729ca30f2