cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Calculate the time between two dates time value

I have a SharePoint List of 5 columns.

1. StartDate(Displaying Date)

2.StartTime(Displaying Time)

3.EndDate(Displaying Date)

4.EndTime(Displaying Time)

5.CourseDuration(Number Type)

PAdate.png

So I want to calculate the time between Start Date and End Date. For Example my startdate is 25/10/2019 and end date is 28/11/2019. So I want to calculate the time period in hour between "StartDate (9:00)Am(Start time) to End date (5:00)pm(end time). and display the calculated output in the Course Duration in PowerApps Form edit form control. Please ShareWIth me if any body have idea. 

Best Regards,

Padmini

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try with below formula in the default property of the data card for CourseDuration column:

Value(DateDiff((DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0)),(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)),Hours))

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Thnq you very much it is working for me. You solved my problem

View solution in original post

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try with below formula in the default property of the data card for CourseDuration column:

Value(DateDiff((DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0)),(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)),Hours))

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Thnq you very much it is working for me. You solved my problem

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (36,642)