You need to sign in to do that
Don't have an account?
wixxey
Date Comparision in SOQL
Hey!
I have the following SOQL
soql = 'select Id, Name, Price__c, Test_Name__c, Analyte__c , Manufacturer__c, Device__c, URL__c From Assessment__c where '; soql = soql+ 'Id NOT IN (Select Assessment__c From LocationAssesmentRelationship__c where Location__c = \''+ locationId +'\')';
in the Nested SOQL the table LocationAssesmentRelationShip__c has an expiryDate__c column, i want to check whether the ExpiryDate is greater then the Date.today().
Kindly help if possible
You should just be able to use the TODAY literal:
There's more information on the literals at:
http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm
All Answers
You should just be able to use the TODAY literal:
There's more information on the literals at:
http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm
Hi,
You need to declare a date variable which store the today value.
Date todayDate = System.Today();
and put in your code.
soql = 'select Id, Name, Price__c, Test_Name__c, Analyte__c , Manufacturer__c, Device__c, URL__c From Assessment__c where ';
soql = soql+ 'Id NOT IN (Select Assessment__c From LocationAssesmentRelationship__c where Location__c = \''+ locationId +'\'';
soql +=' and expiryDate__c >:todayDate ) ';
Where 'todayDate' is a public variable.