cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mohammadyousaf
Helper I
Helper I

Datediff for same dates.

How do we tackle this issue... datediff calculate 0 where both dates are same. 

 

Date StartDate End
11 October 202111 October 2021

 

DATEDIFF([DATE START], [DATE END], DAY)

Result "0"

1 ACCEPTED SOLUTION

Your welcome, I mean you can try something like this instead

 

If (startday=enddate), 1 , DATEDIFF([DATE START], [DATE END], DAY))

View solution in original post

3 REPLIES 3
Applicable88
Post Prodigy
Post Prodigy

@mohammadyousaf what value do you expect? Since its the same day there is no difference in value. If you want that same day displayed as one than try: 

if (DATEDIFF([DATE START], [DATE END], DAY))= 0, 1, DATEDIFF([DATE START], [DATE END], DAY))

 

Hope that helps. 

Best. 

Thank you, I guess IF workaround should be ok, let me try it.

 

In our line of business... it is calculated as working day regardless of working hours. 

I am trying to find a way where one day is included in the calculations of two dates... even if dates are apart, I miss the first day as working day

 

Your welcome, I mean you can try something like this instead

 

If (startday=enddate), 1 , DATEDIFF([DATE START], [DATE END], DAY))

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.