Jump to content
  • 0

Formula based on Leave days


taylorswiftlover

Question

4 answers to this question

Recommended Posts

  • 0
Just now, taylorswiftlover said:

Hello, 

I have two fields, Start Date and End Date. I want to create a Formula field that will calculate the number of days between the two dates. Can you help?

 

Hello @taylorswiftlover,

You can use the DateDiff function. Follow the formula here: DateDiff(Day, [@field:Start_Date], [@field:End_Date])

Link to comment
Share on other sites

  • 0
Just now, taylorswiftlover said:

Thanks. But I forgot to mention, I only wanted to calculate where all the leave type is set to 'Vacation'. If the value is something else, I can just place a zero or null or something. Will that work?

 

Sure! Just make sure that you have another field for the leave type with text datatype and you can create the formula similar to this:

CASE WHEN [@field:Leave_Type] = 'Vacation' THEN DateDiff(Day, [@field:Start_Date], [@field:End_Date]) ELSE 0 END 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...