Skip to main content
Community site session details

Community site session details

Session Id : v44GCF5lJRcim4V7y8NVg8
Power Automate - Building Flows
Unanswered

Calculate Age (Days) based upon another Date in the past using ticks produces an Error

Like (0) ShareShare
ReportReport
Posted on 17 Dec 2021 09:16:33 by 379

 

I am in need to create the Age in Days based upon in my case the Date of Debt. For that I created a flow that loops through all of my items coming from a SharePoint list. Created a variable named DaysSinceDateDebt and I am using this expression:

 

div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks(outputs('Get_item')?['body/DateofDebt'])),864000000000)

In my Update Item action I have put the following:

 

Lorem1960_1-1639732446287.png

 

 

When I test the flow I get the following error:

 

Lorem1960_2-1639732510733.png

 

Does anyone has any idea what I am doing wrong here?? Thanks for any advise.

 

 

  • mahoneypat Profile Picture
    1,720 on 17 Dec 2021 at 12:52:54
    Re: Calculate Age (Days) based upon another Date in the past using ticks produces an Error

    Your syntax to get calculate age in hours looks correct (checked it with a hard-coded date), but it looks like your date column is coming in as an integer.  I would use just that part of your expression to see the value. You may need to use addDays('1899-12-30', <your date value>) to convert it to a date first.

     

    Pat

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete