Skip to main content

Switch function not calculating date add correctly

  • January 2, 2025
  • 1 reply
  • 13 views

Forum|alt.badge.img+4

Hello!

I was recently helped on another post to create parameters for the dateadd function. However, it is not calculating dates correctly. Why? How do I fix this?

Here is my function:

SWITCH(
  Task,
  'Email for photo, new hire survey, and short bio of new hire', DATEADD({Hire Date}, -7, 'days'),
  'Assign desk space for new hire', DATEADD({Hire Date}, -3, 'days'),
  'Give Uniform', {Hire Date},
  'Collect how to contact employee while OOO', DATEADD({Hire Date}, 1, 'days')
)
 

The complete by dates should be: 12/24, 12/31, 12/28, and 1/1

 

1 reply

Dimitris_Goudis
Forum|alt.badge.img+20

Hey @ler1995

Please be sure you are using the same timezone in both fields. The issue is on the DateAdd formula, not in Switch. 

Thanks,
Dimitris Goudis