Skip to content


Dynamics CRm 2011 Query Criteria

CRMLuke asked 8 years ago
I'm trying to add a date filter for a dynamic value of today to a Microsoft Dynamics CRM 2011 Query as a Data Source.

I've tried the following values:
  • GetDate()
  • (GetDate())
  • DateTime.Now.ToShortDateString()
  • System.DateTime.Now.ToShortDateString()
When I click the Data tab I get the error: "the date-time format for DateTime.Now.ToShortDateString() is invalid, or value is outside the supported range."

Any suggestions would be nice. There are no dynamic criteria examples in the SmartConnect 2012 PDF.
Chris replied 8 years ago

Does the value have to be part of the data source? Or do you just need it at some point later in the map so you can pass that through to a field?

It would be much easier to set up a calculated field that would return the current date as it would look something like this:

Return Date.Now.ToString("MM/dd/yyyy")


CRMLuke replied 8 years ago

It should be a part of the source. I don't want all "other" records, I just want a subset. Asking CRM for all the records could be suicide from a data perspective.

If you would like to submit an answer or comment, please sign in to the eOne portal.