web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How I can get the date...
Power Apps
Unanswered

How I can get the dates which are lying between the from date and To date

(0) ShareShare
ReportReport
Posted on by 141

Hi Everyone, Actually I am working on leave app(canvas app) in which I have made a custom calendar, on that calendar I want to show the applied leave's  Sessions Label name: for example
If a user is taking leave from 01-08-2022, Session1 (from date) to 03-08-2022, Session 1((To date) the number of days will count as 2.5 days ,
01-08-->01-08=1 day (Full day leave) S1-S2
02-08-->02-08=2 days (full day leave)S1-S2
03-08-->03-08=0.5 day (half day leave)S1-S1 
total days=2.5
here S1 And S2 are just working as AM and PM
Basically I just want the dates which are lying between the from date and To date
on calendar I just want show these Sessions names(S1-S2) as per the requirement, I have also attached the pics for the reference I hope it will give you some help for understanding.
Thanks. 

Capture1.PNG
Capture3.PNG
Categories:
I have the same question (0)
  • LuizVicente Profile Picture
    984 Super User 2024 Season 1 on at

    Do you want to know how many days there are between StartDate and EndDate? If so, use the DateDiff function:

    DateDiff(StartDate, EndDate, Days)
  • goel_gagandeep Profile Picture
    141 on at

    Thanks @LuizVicente for your response, but my scenario is different so this code is not suitable for my requirement

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @goel_gagandeep ,

     

    To get dates between two dates, you can use below approach:

    Collect(colDates, ForAll(Sequence(DateDiff(FromDate, ToDate),0),AddDays(FromDate, ThisRecord.Value))

     

    The issue is, if there were weekends lay between from and to dates, you need to exclude them, which will make the situation complicated.

     

    Best regards,

  • goel_gagandeep Profile Picture
    141 on at

    Hi @v-jefferni , first of all thanks for the response Basically I want this

     

    goel_gagandeep_0-1661143247890.png

     

    As you seen above mentioned picture i.e. the table(LeaveHistory) record's Pic ,
    In record pic I have applied for the leave 1/8/2022(from_date)(Session1)-3/8/2022(to_date)(session2) Basically I just want to break this record into three entries for example:
    01-08-->01-08=1 day (Full day leave) S1-S2
    02-08-->02-08=2 days (full day leave)S1-S2
    03-08-->03-08=0.5 day (half day leave)S1-S1 
    Here, S1= Session1& S2= Session2
    I hope you all now understand my problem, so is there any way to split the record as per the requirement.
    Thanks.

    Is that possible?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard