You need to sign in to do that
Don't have an account?
lovetolearn
Multiple Conditional Statements in SOQL Query
Hi,
I am trying to create a SOQL with two AND conditons. It would look something similar to this: SELECT ID FROM Contact Where firstName ! = 'Test' AND lastName = 'User' AND Date_of_Birth__c != TODAY]. I know this syntax is not correct, but I am not sure what the correct syntax would be in this case. Please help. Thank you.
I cannot confirm the custom field, but there seems to be an error in firstName ! = 'Test'. There is a space between ! and =
SELECT ID FROM Contact Where firstName != 'Test' AND lastName = 'User' AND Date_of_Birth__c != TODAY
Hi,
Thanks for your help. Thats actually a typo on my end.
My biggest question is it possible to use two conditional statements in a SOQL query?
Like the two ANDs you have in your query? Sure, its perfectly valid.
Yep. Keeping getting a Save error though.
Could you paste your entire code along with the error you get on Save?
appart for the custom field mentioned ,which for all we know might not exist,
try -
System.Today() instead of TODAY