You need to sign in to do that
Don't have an account?
Julie Curry 19
SOQL CreatedDate issue
My organization is looking to archive some records some I'm running some preliminary numbers for records we might want to archive. I'd like to run a bunch of standard queries looking at records created >4 years ago. When I add 'WHERE CreatedDate != LAST_N_DAYS:1460' at the end of my query I'm not getting anything. Is this the wrong way to do this query?
Thanks in advance for your help!
Thanks in advance for your help!
If you are looking for the records which are created more than 4 years ago -> CreatedDate < LAST_N_DAYS:1460
If you are looking for the records which are created within the last 4 years -> CreatedDate = LAST_N_DAYS:1460
Regards.
Ugur
Sample Query
SELECT Id FROM Account WHERE CreatedDate = LAST_N_DAYS:365
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks.