Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 7th, 2004, 05:51 AM
mezza1 mezza1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 mezza1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 28 sec
Reputation Power: 0
Question Date Calculations - Week Days

I have the following 3 fields, in tblContacts

C_daterequest_rec (Log Date) = Default to Date() when records is created
C_DatetoCompleteBy (Completed Date) = Log Date + 20 (Weekdays Only)
C_daystocomplete (Days to Complete) = Completed Date - Date()

I cannot seem to get the calcualation for the 'completed Date' to work.

I want it to be an actual date stored in my contacts table, but it to be calculated
after the logdate is set on creation of the log date. I cannot just add 20 days, as i want it
to add 20 weekdays (working days) to the log date, so that it gives a date the request needs
to be completed by.

Then the days to complete calculates the remaining days to the deadline.

Any help on getting the complete date calculation working would be greatly appreciated...

thanks

Mezza1

Reply With Quote
  #2  
Old December 7th, 2004, 08:57 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 4
Hi Mezza1

20 workdays will include 4 weekends for a total of 28 days

C_DatetoCompleteBy = DateAdd("d",28,[C_daterequest_rec])

To get the difference in number of days from current date to completion date

C_daystocomplete = DateDiff("d",Date,[C_DatetoCompleteBy])

Bear in mind that DaystoComplete will include weekend days, so if you want to exclude weekend days from the calculations you will need to develop a select case statement to evaluate the number of total days and then subtract the number of weekend days from that total. Example if the number of DaystoComplete was between 7 and 11 then you would subtract 2 for one complete weekend.

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Date Calculations - Week Days


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway