Date Filter split to StartDate and EndDate

LBinDENMARKLBinDENMARK Member Posts: 33
I have a DataItem with Employee No and Date Filter. I would like my users to only set filters on this Data Item, but next Data Item (Employee Absence) only have Start and End Date´s. Is there a clever metod to copy Date Filter from first Data Item to the second one? Filters could be both ..010110 , 010111..311211 , 010112.. , 101011

Anyone with a nice way....?

Comments

  • MarkHamblinMarkHamblin Member Posts: 118
    You could use GETRANGEMIN and GETRANGEMAX to force the user to always enter a start and end date in the filter, or you could parse the filter string, e.g.:
    Pos := STRPOS(GETFILTER("Date Filter"), '..');
    IF (Pos < 2) THEN
      MESSAGE('Max = %1', GETRANGEMAX("Date Filter"))
    ELSE IF Pos = STRLEN(txtDateFilter)-1 THEN
      MESSAGE('Min = %1', GETRANGEMIN("Date Filter"))
    ELSE
      MESSAGE('%1 - %2', GETRANGEMIN("Date Filter"), GETRANGEMAX("Date Filter"));
    
Sign In or Register to comment.