You need to sign in to do that
Don't have an account?
Vivek Pandey 102
Need to get user details who login in last 90 days from current day/date
Hi Folks,
I am working on a requirement to get the users who last login was in 90 days peroid and they somehow were deactivated. So I have to activate them again through batch. I am done with batch but the query to fetch is not working. It gives records which are beyond 90 days like from 2019,2020 and 2021... That should not happen , it should give just 91 days old records-
Query I used-
SELECT Id, isActive FROM User where isActive = false and Profile.name = \'XYZ\' and LastLoginDate <= LAST_N_DAYS:90
Can anyone suggest how this query be fine tuned to get probable records for update.
I am working on a requirement to get the users who last login was in 90 days peroid and they somehow were deactivated. So I have to activate them again through batch. I am done with batch but the query to fetch is not working. It gives records which are beyond 90 days like from 2019,2020 and 2021... That should not happen , it should give just 91 days old records-
Query I used-
SELECT Id, isActive FROM User where isActive = false and Profile.name = \'XYZ\' and LastLoginDate <= LAST_N_DAYS:90
Can anyone suggest how this query be fine tuned to get probable records for update.
Recommend reviewing https://salesforce.stackexchange.com/questions/335774/soql-to-pull-lastlogindate-from-past-2-hours-but-not-last-30-minutes