I've created a new field, whole number, calculated, and am trying to calculate the age of a person from the default fields using:
and I even tried
but the second parameter keeps throwing an exception because it is a date and time field (see below).
Can anyone please suggest what I'm doing wrong?
Thanks in advance!
Solved! Go to Solution.
I don't use CDS so flying blind, but just reading the docs it sounds like your birthdate Field could either Date only or Date and Time. So have you tried using Today() instead of Now(), eg
Yes, it does sound like they are different types even though the are dateTime types ... DateTime types across the entire Power Platform drive me nuts.
I was reading this documentation and it seems you may need the help of a developer to change UTC types programmatically, which sucks.
The last thing I'd try would be to wrap both in the DateTimeValue function and see what happens. Maybe try tagging one of the MS moderators to see if they have a solution?
Nice work mate! I had fun trying to work through a solution with you and it made me happy to see you solved it yourself 🙂
All the best.
Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.
Your chance to join an engaging competition of Power Platform enthusiasts.