how to get start of the year and end of the year?

julkifli33julkifli33 Member Posts: 1,087
hi all...
i want to do filtering
for example 27/06/11 --> so it means filtering become 01/01/11..31/12/11
if 01/01/10 --> so it means 01/01/10..31/12/10
as long as i remember to get the first month is CM, is it?
can we use CY? and how about end of year?

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Beginning of the year:
    CALCDATE('<-CY>',YourDate);
    
    End of the year:
    CALCDATE('<CY>',YourDate);
    

    And please, try to use the search next time. Thx.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • krikikriki Member, Moderator Posts: 9,110
    Or also:
    datStartOfYear := DMY2DATE(1,1,DATE2DMY(datYourDate,3));
    datEndOfYear := DMY2DATE(31,12,DATE2DMY(datYourDate,3));
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • julkifli33julkifli33 Member Posts: 1,087
    kriki wrote:
    Or also:
    datStartOfYear := DMY2DATE(1,1,DATE2DMY(datYourDate,3));
    datEndOfYear := DMY2DATE(31,12,DATE2DMY(datYourDate,3));
    
    thanks a lot
Sign In or Register to comment.