p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Access (http://p2p.wrox.com/access-18/)
-   -   Calculate Percentage with Date (http://p2p.wrox.com/access/65577-calculate-percentage-date.html)

mateenmohd January 29th, 2008 07:07 AM

Calculate Percentage with Date
It is possible to calculate the Percentage of project work
completed by given two dates ?

We have three fields in the form and table.


actual_str_date 1/1/2007
completion_date 1/1/2008

if work completed in time, it means work_completed 100%

if work not completed in give date, i.e. work should be completed
in 1/1/2008 due to some reasons work not completed in time

then in work_completed field it show percentage of work completed
ie. 70 % or 80% or 90% an so on....

we can give formula in form field property that it calculate
the percentage of work completed ?

Thanks and regards

mmcdonal January 29th, 2008 09:45 AM

Usually the work completed field is filled out by the project manager, and not calculated based on time. That would be a time burn rate, not a work completed calculation. If it is 7/1/2007, then you have burned 50% of your time, but you might not have done any work yet. Usually the values submitted are 25%, 50%, 75% and 100%. They are significant of various stages in project completion, so that users don't have to tease out 34.76%, for example.

That being said, do you want all days (364) or work days (260)?

The way you would do this is to calculate the number of days between your start and end dates, then calculate the number of days between your start date and today, then calculate the percentage of burned time like:

I wrote this little script to demonstrate based on total days:

dtStart = #01/01/2008#
dtEnd = #03/01/2008#
dtToday = Date()

iTotal = DateDiff("d", dtStart, dtEnd)
iBurn = DateDiff("d", dtStart, dtToday)

pBurn = iBurn/iTotal

It returns

iTotal = 60
iBurn = 28
pBurn = 0.466666666666667

Then display your results with a percent mask.

Does that help?


Look it up at: http://wrox.books24x7.com

mateenmohd February 4th, 2008 06:26 AM

Thanks for your response.

It is very helpful.
We have to calculate 364 days.
Yes work completed fill by project manager.
it means that I have to create three date fields

2.insdate (inspection date)
3.enddate (work completed date)

mostly work delayed, work not completed in given date
ie. today date work should be completed, but due to some reasons
work delayed, in this case we have to
1. find work competed % ?
2. number of days work delayed ?

above code will use on mouse lost focus event of insdate form field
(Inspection date) ?

Thanks and regards

All times are GMT -4. The time now is 01:19 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.