2 Replies Latest reply on Dec 28, 2011 11:58 AM by MikeEdwards

    Date Sort

    MikeEdwards

      Title

      Date Sort

      Post

      We have a date field for employee start dates and we wanted to sort them by the day and month of the hire and not by the year so we could achieve an anniversary date of their start each year.  I wanted to put together a summery portal of employees with upcoming anniversaries who would drop to the bottom of the list after their date had past.

        • 1. Re: Date Sort
          philmodjunk

          Define two calculation fields:

          MonthHire: Month ( StartdateField )

          DayHire: Day ( StartDateField )

          You can then sort by MonthHire, then by DayHire.

          You can compute the next anniversary date with this unstored calculation:

          Let ( T = Get ( Currentdate ) ; Date ( MonthHire ; DayHire ; Year ( T ) + (MonthHire > Month ( T ) and DayHire > Day ( T ) ) ) )

          + (MonthHire > Month ( T ) and DayHire > Day ( T ) )

          adds 1 to the year if the current date is after this year's anniversary date.

          • 2. Re: Date Sort
            MikeEdwards

             Thanks !