Jump to content

Calculating days and time


This topic is 1993 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm trying to create a calculation field that calculates time and days it took to quote.

I have record created date and record created time fields and then record quoted date and record quoted time fields.

I'm hoping to have a field that shows average time to quote 3 days, 34 minutes

Anyone have experience on something like this?

Thank you

Link to comment
Share on other sites

5 hours ago, Matthew R White said:

have record created date and record created time fields and then record quoted date and record quoted time fields.

You could save two fields here by using timestamp fields instead.

Anyway, you can easily calculate the duration by subtracting:

Timestamp ( QuotedDate ; QuotedTime ) - Timestamp ( CreationDate ; CreationTime )

That will give you the total duration in seconds, and now you need to divide it into days, hours and minutes (assuming that's how you want to display it) =

Let ( [
elapsed = Timestamp ( QuotedDate ; QuotedTime ) - Timestamp ( CreationDate ; CreationTime ) ;
days = Div ( elapsed ; 86400 ) ;
time = Mod ( elapsed ; 86400 ) ;
hours = Hour ( time ) ;
minutes = Minute ( time )
] ;
days & " days, " & hours & " hours and " & minutes & " minutes"
)

If this is meant to show an average, then calculate only the elapsed duration, use a summary field to produce the average duration, and another calculation field to break the summary value into its individual components as shown.

 

Edited by comment
Link to comment
Share on other sites

This topic is 1993 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.