where clause to retrieve case record which are older than 12 months and 1 day in soqlError in WHERE clause of...

What shortcut does ⌦ symbol in Camunda macOS app indicate and how to invoke it?

Transitive action of a discrete group on a compact space

Set vertical spacing between two particular items

Golf the smallest circle!

ArcGIS Intersect Tool not splitting lines as expected?

Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?

Do I have to roll to maintain concentration if a target other than me who is affected by my concentration spell takes damage?

The Puzzling Reverse and Add Sequence

Cross over of arrows in a complex diagram

Should I include salary information on my CV?

Math PhD in US vs Master + PhD in Europe

Difference between 'demás' and 'otros'?

How do accents of a whole town drift?

“Transitive verb” + interrupter+ “object”?

Do sudoku answers always have a single minimal clue set?

Was "I have the farts, again" broadcast from the Moon to the whole world?

How well known and how commonly used was Huffman coding in 1979?

Does a centaur PC also count as being mounted?

Why is a blank required between "[[" and "-e xxx" in ksh?

Children's short story about material that accelerates away from gravity

What are good ways to spray paint a QR code on a footpath?

How do I spend money in Sweden and Denmark?

Does the UK have a written constitution?

Conduit Fill and Derating for THHN Cables (outdoor run)



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 19 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 19 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

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m