New workdays

ooopepi

New member
Local time
Today, 16:51
Joined
Mar 30, 2009
Messages
2
Hi friends,
This is my first topic in forum.
I search and read all about “Workdays”, but have some questions.

So, I create leave Access file and my request to show all working days in current month without Saturday and Sundays and Holidays. So in forum read so many topics but…. my trouble is:


I create access db like “Leave Dates Access 2000” (see attachment) . Thank you Jon K!!!!
This decision is most close with my erudition and I know is most easiest my colleague to change every year only one table with working days.

My question is how to change code(because I have so little knowledge) to see only this days in one month.
Example: 01.01.2009 to 27.03.2009 – how can I see how many workdays are in January, February, March.
Like: January 22 days
February 17 days
March 21 days

The code is:

SELECT [tbl_Leave].[LeaveID], [tbl_Leave].[StaffID], [tbl_Leave].[StartDate], [tbl_Leave].[EndDate], Count([tbl_WorkDays].[WorkDay]) AS [Number Of WorkDays]
FROM tbl_Leave, tbl_WorkDays
WHERE ((([tbl_WorkDays].[WorkDay]) Between [tbl_Leave].[StartDate] And [tbl_Leave].[EndDate]))
GROUP BY [tbl_Leave].[LeaveID], [tbl_Leave].[StaffID], [tbl_Leave].[StartDate], [tbl_Leave].[EndDate];

Thank you in advance!
 

Attachments

Hi -

I'm seriously confused. You talk about work days, which are generally interpreted as Monday - Friday. This example seems to follow that

Like: January 22 days
February 17 days
March 21 days

although the correct computation would be:
Code:
Like: January 22 days  
February [COLOR="red"]20[/COLOR] days
March [COLOR="red"]22[/COLOR] days

Yet your tbl_WorkDays lists every day in year 2004 - 366 records in all with no indication of which might be workdays and which are not.

Your query returns total number of days between two dates. There is nothing about workdays, non-workdays.

Would you please restate what you are after and discuss your interpretation of workdays.

Bob
 
Thank you very much for quick answer.
Sorry for my confused question.
Let explain again (rework my table “tbl_WorkDays” only with workdays (without Saturday and Sundays and Holidays):
month workdays(without Saturday and Sundays and Holidays)
1 22
2 20
3 21
4 22
5 18
6 22
7 23
8 21
9 22
10 22
11 21
12 23

I have 3 accounts:


Account Days leave *
Kid1 60
Kid2 1
Kid3 2

*See table “tbl_Leave”
StaffID StartDate EndDate Number Of WorkDays
kid1 01.01.2009 22.02.2009 37
kid2 12.02.2009 12.02.2009 1
kid1 27.02.2009 01.04.2009 23
kid3 03.03.2009 05.03.2009 2


Now I want to know how many days from Kid 1 is in January, February and March for example:

Account Days leave
Kid1 60 22 – January; 20 - February; 16 – March
Kid2 1 1- February
Kid3 2 2 - March

This is my idea, i think that now is more clearly.
Now i must change my code, that so i can see leave days by month, like in example.

 

Attachments

Users who are viewing this thread

Back
Top Bottom