Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Counting Working Days

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  What kind of 2.5" HD adapter do I need?  
Author Message
John Taylor

External


Since: Feb 8, 2009
Posts: 2



(Msg. 1) Posted: Sat Jan 16, 2010 9:25 pm
Post subject: Counting Working Days
Archived from groups: microsoft>public>access (more info?)

Basically I have created a combo box called "Priority" with two fields - one
is text, the other is a number.

The data goes like this

Text field "High - within 14 working Days" the number field is (obviously)
"14"
Text field "Normal - within 28 working Days" the number field is (obviously)
"28"

I also have another field "Days" to add the number to a date - but I only
want to count working days - can this be done. For example if I open a
record on 5th January, then 14 working days is actually 18 days. However if
I open a record on say 9th January the actual days are 20.

The date fields I use are simply a "OpenedDate" and a "DueDate" - the number
from the combo box goes to a field called "Days"

I have an "OnChage" event in the combo box like this: -

Private Sub Priority_Change()

Me!days = Me!Priority.Column(1)

If Me!Priority = "Normal - within 28 working Days" Then

Me!DueDate = Me!OpenedDate + Me!Days

ElseIf Me!Priority = "High - within 14 working Days" Then
Me!DueDate = Me!OpenedDate + Me!Days


End If


End Sub

All my code works as it should - is there some way of "coding" working days
(or non working days".

All help will be greatly appreciated.

Using A2003

John Taylor

 >> Stay informed about: Counting Working Days 
Back to top
Login to vote
Tom Wickerath

External


Since: Nov 26, 2008
Posts: 30



(Msg. 2) Posted: Sat Jan 16, 2010 9:25 pm
Post subject: RE: Counting Working Days
Archived from groups: per prev. post (more info?)

Hi John,

Try one of the functions found here. The second one includes use of a table
to store company specific holidays, so that these days are not counted as
working days:

[URL="http://www.mvps.org/access/datetime/date0006.htm"]http://www.mvps.org/access/datetime/date0006.htm[/URL]


Tom Wickerath
Microsoft Access MVP
[URL="http://www.accessmvp.com/TWickerath/"]http://www.accessmvp.com/TWickerath/[/URL]
__________________________________________

"John Taylor" wrote:

> Basically I have created a combo box called "Priority" with two fields - one
> is text, the other is a number.
>
> The data goes like this
>
> Text field "High - within 14 working Days" the number field is (obviously)
> "14"
> Text field "Normal - within 28 working Days" the number field is (obviously)
> "28"
>
> I also have another field "Days" to add the number to a date - but I only
> want to count working days - can this be done. For example if I open a
> record on 5th January, then 14 working days is actually 18 days. However if
> I open a record on say 9th January the actual days are 20.
>
> The date fields I use are simply a "OpenedDate" and a "DueDate" - the number
> from the combo box goes to a field called "Days"
>
> I have an "OnChage" event in the combo box like this: -
>
> Private Sub Priority_Change()
>
> Me!days = Me!Priority.Column(1)
>
> If Me!Priority = "Normal - within 28 working Days" Then
>
> Me!DueDate = Me!OpenedDate + Me!Days
>
> ElseIf Me!Priority = "High - within 14 working Days" Then
> Me!DueDate = Me!OpenedDate + Me!Days
>
>
> End If
>
>
> End Sub
>
> All my code works as it should - is there some way of "coding" working days
> (or non working days".
>
> All help will be greatly appreciated.
>
> Using A2003
>
> John Taylor

 >> Stay informed about: Counting Working Days 
Back to top
Login to vote
Tom Wickerath

External


Since: Nov 26, 2008
Posts: 30



(Msg. 3) Posted: Sat Jan 16, 2010 9:25 pm
Post subject: RE: Counting Working Days
Archived from groups: per prev. post (more info?)

PS. Here is another set of functions:

[URL="http://www.mvps.org/access/datetime/date0012.htm"]http://www.mvps.org/access/datetime/date0012.htm[/URL]

For example, given a table of holidays and today's date, you can calculate
the date that is X number of working days later (dhAddWorkDaysA function).


Tom Wickerath
Microsoft Access MVP
[URL="http://www.accessmvp.com/TWickerath/"]http://www.accessmvp.com/TWickerath/[/URL]
__________________________________________

"Tom Wickerath" wrote:

> Hi John,
>
> Try one of the functions found here. The second one includes use of a table
> to store company specific holidays, so that these days are not counted as
> working days:
>
> [URL="http://www.mvps.org/access/datetime/date0006.htm"]http://www.mvps.org/access/datetime/date0006.htm[/URL]
>
>
> Tom Wickerath
> Microsoft Access MVP
> [URL="http://www.accessmvp.com/TWickerath/"]http://www.accessmvp.com/TWickerath/[/URL]
> __________________________________________
>
> "John Taylor" wrote:
>
> > Basically I have created a combo box called "Priority" with two fields - one
> > is text, the other is a number.
> >
> > The data goes like this
> >
> > Text field "High - within 14 working Days" the number field is (obviously)
> > "14"
> > Text field "Normal - within 28 working Days" the number field is (obviously)
> > "28"
> >
> > I also have another field "Days" to add the number to a date - but I only
> > want to count working days - can this be done. For example if I open a
> > record on 5th January, then 14 working days is actually 18 days. However if
> > I open a record on say 9th January the actual days are 20.
> >
> > The date fields I use are simply a "OpenedDate" and a "DueDate" - the number
> > from the combo box goes to a field called "Days"
> >
> > I have an "OnChage" event in the combo box like this: -
> >
> > Private Sub Priority_Change()
> >
> > Me!days = Me!Priority.Column(1)
> >
> > If Me!Priority = "Normal - within 28 working Days" Then
> >
> > Me!DueDate = Me!OpenedDate + Me!Days
> >
> > ElseIf Me!Priority = "High - within 14 working Days" Then
> > Me!DueDate = Me!OpenedDate + Me!Days
> >
> >
> > End If
> >
> >
> > End Sub
> >
> > All my code works as it should - is there some way of "coding" working days
> > (or non working days".
> >
> > All help will be greatly appreciated.
> >
> > Using A2003
> >
> > John Taylor
 >> Stay informed about: Counting Working Days 
Back to top
Login to vote
Arvin Meyer [MVP]

External


Since: Dec 4, 2008
Posts: 38



(Msg. 4) Posted: Sat Jan 16, 2010 10:08 pm
Post subject: Re: Counting Working Days
Archived from groups: per prev. post (more info?)

And in addition to the link that Tom points out, you can add or subtract
working days with:

[URL="http://www.datastrat.com/Code/GetBusinessDay.txt"]http://www.datastrat.com/Code/GetBusinessDay.txt[/URL]
 >> Stay informed about: Counting Working Days 
Back to top
Login to vote
John Taylor

External


Since: Feb 8, 2009
Posts: 2



(Msg. 5) Posted: Sun Jan 17, 2010 12:25 am
Post subject: Re: Counting Working Days
Archived from groups: per prev. post (more info?)

Thanks All - still struggling a bit but I can see the logic

John
"Tom Wickerath" <AOS168b AT comcast DOT net> wrote in message

> Hi John,
>
> Try one of the functions found here. The second one includes use of a
> table
> to store company specific holidays, so that these days are not counted as
> working days:
>
> [URL="http://www.mvps.org/access/datetime/date0006.htm"]http://www.mvps.org/access/datetime/date0006.htm[/URL]
>
>
> Tom Wickerath
> Microsoft Access MVP
> [URL="http://www.accessmvp.com/TWickerath/"]http://www.accessmvp.com/TWickerath/[/URL]
> __________________________________________
>
> "John Taylor" wrote:
>
>> Basically I have created a combo box called "Priority" with two fields -
>> one
>> is text, the other is a number.
>>
>> The data goes like this
>>
>> Text field "High - within 14 working Days" the number field is
>> (obviously)
>> "14"
>> Text field "Normal - within 28 working Days" the number field is
>> (obviously)
>> "28"
>>
>> I also have another field "Days" to add the number to a date - but I only
>> want to count working days - can this be done. For example if I open a
>> record on 5th January, then 14 working days is actually 18 days. However
>> if
>> I open a record on say 9th January the actual days are 20.
>>
>> The date fields I use are simply a "OpenedDate" and a "DueDate" - the
>> number
>> from the combo box goes to a field called "Days"
>>
>> I have an "OnChage" event in the combo box like this: -
>>
>> Private Sub Priority_Change()
>>
>> Me!days = Me!Priority.Column(1)
>>
>> If Me!Priority = "Normal - within 28 working Days" Then
>>
>> Me!DueDate = Me!OpenedDate + Me!Days
>>
>> ElseIf Me!Priority = "High - within 14 working Days" Then
>> Me!DueDate = Me!OpenedDate + Me!Days
>>
>>
>> End If
>>
>>
>> End Sub
>>
>> All my code works as it should - is there some way of "coding" working
>> days
>> (or non working days".
>>
>> All help will be greatly appreciated.
>>
>> Using A2003
>>
>> John Taylor
 >> Stay informed about: Counting Working Days 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
counting Charaters - I have some code that i want to use depending on how many charaters have been enterer into txtBox for examples If txtBox has 8 characters then do follwoing code ........ If txtBox has 3 character then do this codes......... I just do not know how to...

Age in Days If Then - Hello, I have a table called tblPatients with about 200,000 records with two date fields. One is AdmitDate and the other is DateOfBirth. I am trying to calculate two additional fields based on these date fields. One is called AgeYears which is..

Number of days between two dates excluding Holidays and we.. - I am trying to calculate the number of days between two dates excluding weekends and holidays. I have seen and read several posts out on the web that does this but now have a couple of questions. 1. How do I incorporate the VB coding on the web into...

SUBFORM was working and now it's not - Hi, My subform (order details) in a purchase order has been working and now is not. I have not made any changes to either form or subform... so I'm baffled as to why it would suddenly stop working. What it is doing (or more accurately not doing): ...

if statement not working - Access 2003 code on forms oncurrent event... I want the below If DLookup is Admin then TitleMSP.Visible = True Label95.Visible = False Label97.Visible = True Label96.Visible = True If DLookup is Admin and Not..
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]