Can anyone please help me to get Last two months records for particular object in Apex Class ( how to write condition for that )
Currently Using below condition in Query
CreatedDate = LAST_N_MONTHS:2 AND CreatedDate < LAST_N_MONTHS:1
Thanks in Advance
1 answer
Lakhan Meghani (NA) Forum Ambassador
Hey Rakesh,
use this-
Select Id,CreatedDate FROM contact Where CreatedDate = LAST_N_MONTHS:2