Skip to content
+1-888-319-3663

COMMUNITY FORUM

Current date in a CRM Query criteria

Jamie asked 3 years ago
Hi There,
I’m simply trying to narrow the results of a CRM Query as a Datasource to the current date.  i.e. Contact.[Created On] > GetDate().  Obviously it’s not using true SQL syntax as GetDate() doesn’t work.  I’ve tried .NET syntax as well with no luck.  I simply get the error “The Date-Time format for xxx is invalid….”.  There must be a trick I’m missing…
Thanks!
Answers
Ethan Sorenson Staff answered 3 years ago
Jamie,
We have a good blog post about this scenario. You can use scripting to pull the current date and assign it to a global variable. Then use the Global Variable in your source query.
https://www.eonesolutions.com/tech-tuesday-create-new-global-variable-crm-query/
https://www.eonesolutions.com/help-article/kba-01074-f3b8y5/
 
Jamie replied 3 years ago

Awesome! That’s what I was looking for. Thank you


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