Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Convert days to year, month & days Post Reply Post New Topic
Author Message
yeller
Newbie
Newbie
Avatar

Joined: 06 Feb 2014
Online Status: Offline
Posts: 12
Quote yeller Replybullet Topic: Convert days to year, month & days
    Posted: 09 Nov 2016 at 4:15am
Hello,

I could use some help with a formula. This simple formula gives me what I want in total number of days. I need to display that as total number of years, months & days.

Any help much appreciated.

CurrentDate - {flow.Status_Date}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Nov 2016 at 4:33am
how are defining this?
Is jan 1 2017 - Dec 31-2016 1 year or 1 month or 1 day or all three?
You can't really just just divide by something as the days in each month vary. You won't really get any kind of accurate month so you need to be more precise in how you are defining the difference. That will give you an understanding on how to write a formula to support that definition.

Edited by DBlank - 09 Nov 2016 at 4:33am
IP IP Logged
yeller
Newbie
Newbie
Avatar

Joined: 06 Feb 2014
Online Status: Offline
Posts: 12
Quote yeller Replybullet Posted: 09 Nov 2016 at 4:45am
The result of the current formula, CurrentDate - {flow.Status_Date}, gives me a total number of days i.e.
2,356
I'd like to display that in my report as total number of years.
i.e.
6.45
If possible, break it down to years, months and days, but I'd be happy with the 6.45 years
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Nov 2016 at 5:04am
(CurrentDate - {flow.Status_Date})/365
IP IP Logged
yeller
Newbie
Newbie
Avatar

Joined: 06 Feb 2014
Online Status: Offline
Posts: 12
Quote yeller Replybullet Posted: 09 Nov 2016 at 5:27am
Thank you very much!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.066 seconds.