Skip to main content

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

 

#Salesforce Developer

1 Antwort
  1. Lakhan Meghani (NA) Forum Ambassador
    6. Okt. 2021, 09:05

    Hey Rakesh,

     

    use this-

    Select Id,CreatedDate FROM contact Where CreatedDate = LAST_N_MONTHS:2

0/9000