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;








1















Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL










share|improve this question







New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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

















1















Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL










share|improve this question







New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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













1












1








1








Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL










share|improve this question







New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Please help me in writing where clause to retrieve case record which are older than 12 months and 1 day SOQL







soql






share|improve this question







New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question







New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question






New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 19 hours ago









SureshSuresh

111 bronze badge




111 bronze badge




New contributor



Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Suresh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 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





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










2 Answers
2






active

oldest

votes


















3














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.






share|improve this answer






























    3














    +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.






    share|improve this answer

























      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.









      draft saved

      draft discarded


















      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









      3














      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.






      share|improve this answer



























        3














        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.






        share|improve this answer

























          3












          3








          3







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 18 hours ago









          RajRaj

          365 bronze badges




          365 bronze badges























              3














              +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.






              share|improve this answer



























                3














                +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.






                share|improve this answer

























                  3












                  3








                  3







                  +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.






                  share|improve this answer













                  +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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 18 hours ago









                  Keith CKeith C

                  99.3k11 gold badges101 silver badges235 bronze badges




                  99.3k11 gold badges101 silver badges235 bronze badges




















                      Suresh is a new contributor. Be nice, and check out our Code of Conduct.









                      draft saved

                      draft discarded


















                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її