Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Calculate Years, Months & Days between two dates Post Reply Post New Topic
Author Message
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Topic: Calculate Years, Months & Days between two dates
    Posted: 02 Sep 2011 at 4:29am

Hello,

I need to calculate in years, months and days - the difference between employees Hire Date and today's date.   Any ideas how to do this ?

Thanks!  :)

IP IP Logged
saqibmsd
Newbie
Newbie
Avatar

Joined: 20 Mar 2010
Location: India
Online Status: Offline
Posts: 1
Quote saqibmsd Replybullet Posted: 04 Sep 2011 at 12:30am
numbervar a := (LeavingDate-HiringDate);
numbervar b := a mod 365;
numbervar c := b mod 30;

ToText(Truncate(a/365),0) +" yr(s) "+ ToText(Truncate(b/30),0) +" mth(s) "+ ToText(c,0) +" day(s)";
Share and Spread
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 06 Sep 2011 at 11:03am
thank you so very much!  it worked perfectly!!!  :-)
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.031 seconds.