Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Comparison Percentages 1

Status
Not open for further replies.

Adammon

Programmer
Nov 10, 2001
9
CA

Semi tough question that's been bugging me for a week. I have three dates, a created date, a current date and an end date. What I need is to find out what percentage complete the current date is at.

IE...Started on Monday, Ending on Friday, it is currently Wednesday so the percent complete is 50%

I'm working with fields of DateTime...My original plan had been to convert the DateTime fields to a number and calculate percentage from that..the only problem is I can't find, in Crystal 8.5, how to accomplish this. I know Crystal Decisions has a UFL for converting Numbers to Dates, but I need to go the other way. Any ideas?
 
I'll break it down using days for you, you didn't mention anything about data types, whether it supports hours, and whether you'd want that (change "D" to "H" and use currentdatetime if you do):

(datediff("d",{startdate},currentdate))/(datediff("d",{Startdate},{enddate}))*100

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top