where clause to retrieve case record which are older than 12 months and 1 day in soqlError in WHERE clause of SOQLSOQL where clause use 15-character ID?Why does 18-character ID casing matter in a SOQL WHERE clause?SOQL query minimum Date in WHERE clauseSOQL query with Dataloader using List Literal in WHERE ClauseCan an aggregate function be in SOQL where clause?What is wrong with SOQL Condition Expression Syntax (WHERE Clause)Why are where clause comparison operators case-sensitive when using SOQL to query custom metadata?SOQL Where ID in Clause LimitationSOQL query WHERE filter by specific months
The difference between Rad1 and Rfd1
Coefficients of the characteristic polynomial
Should I hide continue button until tasks are completed?
How was film developed in the late 1920s?
Does the UK have a written constitution?
What shortcut does ⌦ symbol in Camunda macOS app indicate and how to invoke it?
Why is Madam Hooch not a professor?
How should I behave to assure my friends that I am not after their money?
Wilcoxon signed rank test – critical value for n>50
How to determine what is the correct level of detail when modelling?
When to apply Lorentz transformations and laws of time dilations and length contractions: explanations
What are good ways to spray paint a QR code on a footpath?
Is there any set of 2-6 notes that doesn't have a chord name?
Why does this function call behave sensibly after calling it through a typecasted function pointer?
How would a order of Monks that renounce their names communicate effectively?
Can a US President have someone sent to prison?
How well known and how commonly used was Huffman coding in 1979?
Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?
How exactly is a normal force exerted, at the molecular level?
What is the olden name for sideburns?
Is there a short way to check uniqueness of values without using 'if' and multiple 'and's?
A player is constantly pestering me about rules, what do I do as a DM?
Averting Real Women Don’t Wear Dresses
Was "I have the farts, again" broadcast from the Moon to the whole world?
where clause to retrieve case record which are older than 12 months and 1 day in soql
Error in WHERE clause of SOQLSOQL where clause use 15-character ID?Why does 18-character ID casing matter in a SOQL WHERE clause?SOQL query minimum Date in WHERE clauseSOQL query with Dataloader using List Literal in WHERE ClauseCan an aggregate function be in SOQL where clause?What is wrong with SOQL Condition Expression Syntax (WHERE Clause)Why are where clause comparison operators case-sensitive when using SOQL to query custom metadata?SOQL Where ID in Clause LimitationSOQL query WHERE filter by specific months
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL
soql
New contributor
add a comment |
Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL
soql
New contributor
You could have a look at the documentation Date Formats and Date Literals, give it a try and let us know where you are stuck.
– Raul
19 hours ago
add a comment |
Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL
soql
New contributor
Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL
soql
soql
New contributor
New contributor
New contributor
asked 19 hours ago
SureshSuresh
111 bronze badge
111 bronze badge
New contributor
New contributor
You could have a look at the documentation Date Formats and Date Literals, give it a try and let us know where you are stuck.
– Raul
19 hours ago
add a comment |
You could have a look at the documentation Date Formats and Date Literals, give it a try and let us know where you are stuck.
– Raul
19 hours ago
You could have a look at the documentation Date Formats and Date Literals, give it a try and let us know where you are stuck.
– Raul
19 hours ago
You could have a look at the documentation Date Formats and Date Literals, give it a try and let us know where you are stuck.
– Raul
19 hours ago
add a comment |
2 Answers
2
active
oldest
votes
I think you can try using something from this Salesforce link here. SOQL date query filters.
Select Id from Object where Date = LAST_N_DAYS:366.
add a comment |
+1 to Raj's answer if you don't mind being a day out around leap years:
... where CreatedDate < LAST_N_DAYS:366
If you did need to address leap years:
Date d = Date.today().addYears(-1).addDays(-1);
... where DAY_ONLY(convertTimezone(CreatedDate)) < :d
See my colleague's Gotcha: convertTimezone() must be used in SOQL Date functions dealing with Datetime post for an explanation of the need for convertTimezone
.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "459"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Suresh is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f266931%2fwhere-clause-to-retrieve-case-record-which-are-older-than-12-months-and-1-day-in%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you can try using something from this Salesforce link here. SOQL date query filters.
Select Id from Object where Date = LAST_N_DAYS:366.
add a comment |
I think you can try using something from this Salesforce link here. SOQL date query filters.
Select Id from Object where Date = LAST_N_DAYS:366.
add a comment |
I think you can try using something from this Salesforce link here. SOQL date query filters.
Select Id from Object where Date = LAST_N_DAYS:366.
I think you can try using something from this Salesforce link here. SOQL date query filters.
Select Id from Object where Date = LAST_N_DAYS:366.
answered 18 hours ago
RajRaj
365 bronze badges
365 bronze badges
add a comment |
add a comment |
+1 to Raj's answer if you don't mind being a day out around leap years:
... where CreatedDate < LAST_N_DAYS:366
If you did need to address leap years:
Date d = Date.today().addYears(-1).addDays(-1);
... where DAY_ONLY(convertTimezone(CreatedDate)) < :d
See my colleague's Gotcha: convertTimezone() must be used in SOQL Date functions dealing with Datetime post for an explanation of the need for convertTimezone
.
add a comment |
+1 to Raj's answer if you don't mind being a day out around leap years:
... where CreatedDate < LAST_N_DAYS:366
If you did need to address leap years:
Date d = Date.today().addYears(-1).addDays(-1);
... where DAY_ONLY(convertTimezone(CreatedDate)) < :d
See my colleague's Gotcha: convertTimezone() must be used in SOQL Date functions dealing with Datetime post for an explanation of the need for convertTimezone
.
add a comment |
+1 to Raj's answer if you don't mind being a day out around leap years:
... where CreatedDate < LAST_N_DAYS:366
If you did need to address leap years:
Date d = Date.today().addYears(-1).addDays(-1);
... where DAY_ONLY(convertTimezone(CreatedDate)) < :d
See my colleague's Gotcha: convertTimezone() must be used in SOQL Date functions dealing with Datetime post for an explanation of the need for convertTimezone
.
+1 to Raj's answer if you don't mind being a day out around leap years:
... where CreatedDate < LAST_N_DAYS:366
If you did need to address leap years:
Date d = Date.today().addYears(-1).addDays(-1);
... where DAY_ONLY(convertTimezone(CreatedDate)) < :d
See my colleague's Gotcha: convertTimezone() must be used in SOQL Date functions dealing with Datetime post for an explanation of the need for convertTimezone
.
answered 18 hours ago
Keith CKeith C
99.3k11 gold badges101 silver badges235 bronze badges
99.3k11 gold badges101 silver badges235 bronze badges
add a comment |
add a comment |
Suresh is a new contributor. Be nice, and check out our Code of Conduct.
Suresh is a new contributor. Be nice, and check out our Code of Conduct.
Suresh is a new contributor. Be nice, and check out our Code of Conduct.
Suresh is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f266931%2fwhere-clause-to-retrieve-case-record-which-are-older-than-12-months-and-1-day-in%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You could have a look at the documentation Date Formats and Date Literals, give it a try and let us know where you are stuck.
– Raul
19 hours ago