function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CRM_MikeCRM_Mike 

Using the connector to find a date less than "TODAY"

I have tried to build a query that would allow me to interrogate a field, defined as a date, against the current date value (which I believe is "TODAY").  I keep getting the following error:
Error generated by request::
Select id from Asset where Station_Expiration__c < 2008-07-09T00:00:00.000Z
 
Error at Row:1:Column:29
value of filter criterion for field 'Station_Expiration__c must be of type date and should not be enclosed in quotes
ExceptionCode : 5077
 
Please help.
 
Mike
 
 
jcroxjcrox

It looks to me like TODAY is returning a date/time value and all you are looking for is a date.

 

 

CRM_MikeCRM_Mike
True, but if I try to enter just a date, the display above (date + 00.00.00.00) appears in the error text box.
jcroxjcrox
I wonder if assigning TODAY to a variable and then substringing it would work:
 
var fullDate = TODAY
var sqlDate = LEFT(fullDate, 10)
 
.....WHERE column < sqlDate;
 
If not, sorry, I can't think of anything else