Help with current formula for dates

Hi Coda!

I currently have this set up to group my pay periods together. I’m wanting to add the Year into the formula too please, currently it just shows up as “Pay Period September 15 - October 14”, and I’d like it to show “Pay Period September 15 - October 14 2022”. The last paid column shows the date format as “Oct 1, 2022”

If(thisRow.[Last Paid].Day() < 15, Format(“Pay Period {1} 15 - {2} 14”,thisRow.[Last Paid].EndOfMonth(-1).MonthName(), thisRow.[Last Paid].EndOfMonth(0).MonthName()),Format(“Pay Period {1} 15 - {2} 14”,thisRow.[Last Paid].EndOfMonth(0).MonthName(), thisRow.[Last Paid].EndOfMonth(1).MonthName()))

Thank you!

hi @Nikki_Donkin , it has been a while, good to see you back again
what about this one:


If(
  thisRow.paydate.Day() < 14,
  Format(
    "Pay Period {1} 14 - {2} 15 {3}",
    thisRow.paydate.EndOfMonth(-1).MonthName(),
    thisRow.paydate.EndOfMonth(0).MonthName(),
    thisRow.paydate.EndOfMonth(0).Year()
  ),
  Format(
    "Pay Period {1} 14 - {2} 15 {3}",
    thisRow.paydate.EndOfMonth(0).MonthName(),
    thisRow.paydate.EndOfMonth(1).MonthName(),
    thisRow.paydate.EndOfMonth(1).Year()
  )
)
2 Likes

You’re a rockstar @Christiaan_Huizer! You wrote my initial one for me which has worked great, but I’m now a year down the track so needed the year in there to distinguish it! Thank you so much for your help :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.