Calcdate

twctwc Member Posts: 28
Hello,

How could I use CALCDATE tu build a filter with the last 12 complete month?
Today would it be:
01.11.04..31.10.05

Thank you!

Regards,
Tommaso
Tommaso Cereghetti
IT-Consultant

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Something like

    1st date : Workdate - 1Y
    2nd date : Workdate - 1D

    And with this you build your filter.
  • twctwc Member Posts: 28
    But I need the first day of the month and the last one..

    Regards,
    tommaso
    Tommaso Cereghetti
    IT-Consultant
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    CALCDATE('<CM>');

    Returns the last date of the current month, maybe you can calculate from there.
  • jmjm Member Posts: 156
    Hi tommaso,

    try:
    MESSAGE('%1',Last12MonthsFilter());
    
    with this function:
    Last12MonthsFilter() : Text[250]
    
    Enddate := CALCDATE('<-CM-1D>',WORKDATE());
    Startdate := CALCDATE('<+1D-12M>',Enddate);
    
    EXIT(STRSUBSTNO('%1..%2',Startdate,Enddate));
    

    br
    Josef Metz
    br
    Josef Metz
  • twctwc Member Posts: 28
    Hi Josef!

    Great! Thank you!

    Regards,
    Tommaso
    Tommaso Cereghetti
    IT-Consultant
Sign In or Register to comment.