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
Reppin505Reppin505 

Problem passing a query using a custom date field and {!Today}

var SearchString="Select Type, Membership_End_Date__c from Opportunity where AccountId = '{!Account.Id}' And Membership_End_Date__c > {!Today}";
 
When using the above query string i get the error:
 
Malformed query
And Membership_End_Date__c > 9/2/2008
                               ^
Unexpected Token: /
 
I have tried the wrap Membership_End_Date__c with Date() and DateValue() but continue to get the same error.
 
Any help would be greatly appreciated.
 
jpizzalajpizzala
Dates in queries should be in the format YYYY-MM-DD, as opposed to Salesforce's value of M/D/YYYY.