Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 29th, 2008, 06:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 DATE
COMPLETION_DATE DATE
WORK_COMPLETED TEXT

i.e.
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
Mateen




Reply With Quote
  #2 (permalink)  
Old January 29th, 2008, 08:45 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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?

mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #3 (permalink)  
Old February 4th, 2008, 05:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

1.strdate
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
Mateen
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to calculate a number of days between 2 date windy417 Pro JSP 1 July 20th, 2006 07:09 PM
how to calculate the percentage in sql yvr238 SQL Server 2000 1 May 13th, 2006 03:28 AM
Calculate a difference percentage skwilliams Classic ASP Basics 15 April 4th, 2006 06:46 AM
calculate date duration in asp.cet rjkulkarni2001 ASP.NET 2.0 Basics 2 January 13th, 2006 07:35 AM
percentage darkhalf Javascript 2 October 28th, 2005 02:55 PM



All times are GMT -4. The time now is 02:24 AM.


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