Jump to content

Timestamp Difference

Shri G

Recommended Posts

Hi All,

I have to find the difference between two timestamp columns into days. Please find attached data for your reference.

image.png.59b6105d3fb08e8de5edce7f5e697d46.pngFirst column is end date and second column is start date

I tried with Datediff("days",[start date], [end date]) but for some values it is giving negative value.

tried with if(dayofyear([sTART DATE])=dayofyear([END DATE]),0,(Integer(DateDiff("day",[sTART DATE],[END DATE]) / 7) * 5) + DayOfWeek([END DATE]) - DayOfWeek([sTART DATE]) + (if((DayOfWeek([END DATE]) - DayOfWeek([sTART DATE]))<0,5,0))) but getting negative values for some data.

Can somebody please help me with?

Thanks in advance!

Link to comment
Share on other sites

Thank you!

So, here are the dates

End Date Start Date 

01/11/20 06:34 PM 10/03/20 12:00 PM

10/05/20 06:33 PM 06/29/21 12:00 PM

04/17/19 03:03 PM 01/02/20 11:00 AM

So the format (date part) appears to be DD/MM/YY.

The start dates here are AFTER the end dates, which would indeed (this is expected) result in negative for Datediff("days",[start date], [end date]).

What result were you looking for, when the start dates are after the end dates?

Link to comment
Share on other sites

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...