You need to sign in to do that
Don't have an account?
niraj kumar 45
SOQl Query to fetch Previous Previous 6 months records from today
I need to implenet SOQl query to fetch records form Sep 2016- to April 2106 from todays date for created records.
Suppose Today is May 2017 so need a SOQL query that fetches me the records from Sep 2016 to April 2016 which should be dynamic for createdDate records.
I can get the last 6 months records with this query
SELECT Id,CreatedDate FROM content_description__c WHERE CreatedDate = LAST_N_DAYS:180
how do i fetch the other previous 6 months data for created records?
Suppose Today is May 2017 so need a SOQL query that fetches me the records from Sep 2016 to April 2016 which should be dynamic for createdDate records.
I can get the last 6 months records with this query
SELECT Id,CreatedDate FROM content_description__c WHERE CreatedDate = LAST_N_DAYS:180
how do i fetch the other previous 6 months data for created records?
Using Offset and Limit keywords you can retrieve old records.
Ex:
last 180 days you received 50 reocords
so you can write query like below : Hope this helps..
Thanks
Varaprasad
This will get you all the records between 6 -12 months from the current time.
Let me know if you need further help.
Thanks and Regards,
Shiva RV