A developer needs to implement a system audit feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the historical records in the Account object. The developer must ensure the search is able to return history records that are between 6 and 12 months old.
Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 6 to 12 months old?

A)

B)

C)

D)

Given the code snippet, the correct query to retrieve Account History records between 6 and 12 months old would be the one that includes a WHERE clause filtering records where the CreatedDate is greater than or equal to initialDate and less than or equal to endDate. Option B's statement does this correctly by using the >= and <= operators to define the range between initialDate (which is set to today's date minus 12 months) and endDate (set to today's date minus 6 months). Options A, C, and D either use incorrect comparison operators or compare against the wrong variables, resulting in an incorrect data set being returned.
Reference
SOQL Date Formats and Date Literals: SOQL and SOSL Reference Guide
Glory
13 days agoTaryn
18 days agoKris
23 days agoCristen
28 days agoDominque
1 month agoMicheal
1 month agoMarvel
1 month agoBlair
2 months agoDarrin
2 months agoBo
2 months agoDetra
2 months agoTabetha
2 months ago