New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified Platform Developer II (Plat-Dev-301) Exam - Topic 2 Question 123 Discussion

Actual exam question for Salesforce's Salesforce Certified Platform Developer II (Plat-Dev-301) exam
Question #: 123
Topic #: 2
[All Salesforce Certified Platform Developer II (Plat-Dev-301) Questions]

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)

Show Suggested Answer Hide Answer
Suggested Answer: B

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


Contribute your Thoughts:

0/2000 characters
Glory
13 days ago
Hmm, I'm torn between A and D. Gotta love these tricky SQL questions!
upvoted 0 times
...
Taryn
18 days ago
I'm going with Option C. Seems the most straightforward.
upvoted 0 times
...
Kris
23 days ago
Option B looks good to me.
upvoted 0 times
...
Cristen
28 days ago
I vaguely recall that we need to ensure the date filter is inclusive for both ends. I hope I can remember the right syntax!
upvoted 0 times
...
Dominque
1 month ago
I feel like I need to double-check how to specify the date range correctly. Was it using LAST_N_MONTHS or something else?
upvoted 0 times
...
Micheal
1 month ago
I think we practiced a similar question where we had to filter records by date ranges. I might lean towards option C.
upvoted 0 times
...
Marvel
1 month ago
I remember something about date functions in SOQL, but I'm not sure which one applies here.
upvoted 0 times
...
Blair
2 months ago
This is a good test of my SQL skills. I'll carefully evaluate each option and try to eliminate the incorrect choices.
upvoted 0 times
...
Darrin
2 months ago
I think Option B might be the way to go here. The BETWEEN clause looks like it could handle the 6-12 month range nicely.
upvoted 0 times
...
Bo
2 months ago
I'm a bit confused by the date range requirements. I'll need to double-check the syntax for working with dates in SQL.
upvoted 0 times
...
Detra
2 months ago
Okay, let me think this through step-by-step. I need to find a way to filter the Account History records based on the age criteria.
upvoted 0 times
...
Tabetha
2 months ago
Hmm, this looks like a tricky one. I'll need to carefully review the code and options to determine the best approach.
upvoted 0 times
...

Save Cancel