MS CRM 2011 datetime format
-
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.
Semua Balasan
-
16 September 2011 9:17Moderator
Hi Raji
try to create datetime object with your data value and pass the same in criteria.
Mahain : MS CRM Freelancer
- Diedit oleh Mahender PalMVP, Moderator 16 September 2011 9:18
- Disarankan sebagai Jawaban oleh Mahender PalMVP, Moderator 16 September 2011 9:19
-
16 September 2011 9:23
Hi,
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?
Regards
Raji
-
24 Juni 2012 9:35
Hi,
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
thank you,