Skip to main content
Solved

Automatic duration calculator

  • May 2, 2024
  • 3 replies
  • 36 views

Forum|alt.badge.img+3

I want to have a select field with a couple of options for clients that need a subscription. Like: "1 month subscription", "2 month subscription", ... . This would ideally convert the answer into a 31 day duration field that can then be used in a date dependency to calculate the end date for the subscription. Is this possible?


I already figured out that i can convert it to duration using a formula field but then i can't use it in a date dependency...

Best answer by TheTimeSavingCo

Does this look right?

DATEADD( {Start Date}, SWITCH( Subscription, '1 month subscription', 31, '2 month subscription', 62 ), 'days' )

3 replies

Forum|alt.badge.img+11

I'm not sure I'm fully understanding what you're asking. Can you show an example of an expected output?
So far I'm assuming you'd need an automation, but I want to make sure I provide the easiest and best solution for you.


TheTimeSavingCo
Forum|alt.badge.img+31

Does this look right?

DATEADD( {Start Date}, SWITCH( Subscription, '1 month subscription', 31, '2 month subscription', 62 ), 'days' )


Forum|alt.badge.img+3
  • Author
  • New Participant
  • May 3, 2024

Does this look right?

DATEADD( {Start Date}, SWITCH( Subscription, '1 month subscription', 31, '2 month subscription', 62 ), 'days' )


This is exactly what i needed! Don't understand how i didn't think of just not using the date dependency and just using a formula instead...

Thank you very much!