473,395 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Count Working Days

Jerry Maiapu
259 100+
Hi Scott Prince, Since this dean is not interested I need to do the same as Dean is trying to do. Since Dean has not replied would you mind to show me how to do this:
You'll have to open this into a recordset programatically and loop through comparing each date with the fixed holiday date to get your day count minus holidays. Then you can run the result through the weekday count function to return a final number of working days.
I already created a table tblHolidays with fields HolidayID,HolidayDate and HolidayName and enetred all the public holidays in my country.

Thankyou

Jerry

** Admin Edit **
This was moved here from, and is related to, count days.
Jul 6 '10 #1

✓ answered by FishVal


3 2468
colintis
255 100+
@Jerry Maiapu
If you make a table to store the holidays in your country then it would be more simple.

First you will need a query to count number of public holidays occurred in week-days between the date range. Then you do the minus to the number of working days with this count.

In Scott Prince's method, you go through the loop, use the starting date to compare the recordset with month and day. If the month and day are >= the start date, then a -1 to the number of working days, repeat until the ending date. If it will cross to the other year such as 2009 to 2010, then you might need to find a way to count in 2 separate parts (1 for 2009 and 1 for 2010). I'm not sure if there's a better idea to handle the year issue as this is how I did to some similar situation.
Jul 6 '10 #2
FishVal
2,653 Expert 2GB
My 5c .
Jul 6 '10 #3
Jerry Maiapu
259 100+
FishVal's solution worked. Thanks.
Jul 6 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
1
by: jig | last post by:
Hi, Guys I am creating application in ms-access and i am struggling to counting working days when user gives start date and end date. i don't want to count saturday and sunday. So, anyone can...
29
by: Santiagoa | last post by:
If I set up a task table with an Date_assigned and a number of days to complete the task I calculate the end_date field by using the code below I found in this forum How ever when I enter the...
6
by: harky | last post by:
hi Can some one help me with a query? I have a database named login1 with a table called orderoil. i am looking to get the clients details in a table if they have not paid there bill after 30...
2
dnb
by: dnb | last post by:
which function is used to count the days of the month which is selected from calendar in vb 6.0? if i select "2/jan/2008" from calendar in this case days are "31" then how can i display number of...
2
by: Maninder Karir | last post by:
Hi, Im trying to work out how to return a date based on addition of working days only. On the userform the user enters the date using dtpicker. They then have the option to add 5, 10 or 15...
4
by: shilpareddy2787 | last post by:
Hello, I have some total values, I want to calculate percenatge of these Total Values. I want to divide the total with No. Of working Days Excluding Saturdays and Sundays in a given period. ...
0
by: josephsimonbenn | last post by:
I need to calculate the number of business days employees work in each month using vba. The problem is, some employees work 3 days, some 4 and some 5. So i want to be able to turn on/off the days...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.