Question List working days between two dates

mobidv

New member
Local time
Today, 13:56
Joined
Nov 25, 2009
Messages
3
Hi, I have a table with these fields in:

Name
FirstDay - A Date
LastDay - A Date
WorkingDaysBetween - Number of working days between first and last day.

What I would like to know is how to show all working days between the first day and the last day. Is this possible?

Thanks,
 
take a look here:

http://www.access-programmers.co.uk/forums/showthread.php?t=133329&highlight=days

that code is fairly complex, but if you know VBA, you can modify if to suit your needs.

the other thing you should know is that your 3rd field in this table should not be there, as it is not considered SOURCE data. it is CALCULATED data. anything that is calculated from source data, like these working days belong in queries or modules, and then displayed on forms or reports
 
Thanks for your reply. I will have a look at the link.

Also, the field your referring to isn't calculated from source data, it's part of my table and the value is worked out on a php webpage before the user submits the form.
 
I've looked at the link you gave and it doesn't show code to list the days it only shows the cod to work out the number of days between two dates which I already know how to do.

The way I did this in php was to setup a separate table with the dates of the year and a value to show whether they were weekdays or not. Then I would run this SQL query to pull the dates:

SELECT * FROM WeekDates WHERE WeekDate is BETWEEN FirstDay AND LastDay AND ISWEEKDAY = 1

Is there no way to do something like this in access?
 
Try doing a search, there are loads of examples if you bother to take the time.

Some examples also include / exclude public holidays too.

Col
 
I've looked at the link you gave and it doesn't show code to list the days it only shows the cod to work out the number of days between two dates which I already know how to do.

The way I did this in php was to setup a separate table with the dates of the year and a value to show whether they were weekdays or not. Then I would run this SQL query to pull the dates:

SELECT * FROM WeekDates WHERE WeekDate is BETWEEN FirstDay AND LastDay AND ISWEEKDAY = 1

Is there no way to do something like this in access?

i must have missed judged the thread. sorry about that! yes. the translation for the query you wrote above, in access, is this:
PHP:
SELECT *

FROM weekdates

WHERE weekday([weekdate]) <> 0 AND

weekday([weekdate]) <> 6
0 and 6 are sunday and saturday. that might not be right. look up the weekday() function in the help menu to be sure.
 
On a glance, for customers it seems easy but this task need much hours to work on.
 

Users who are viewing this thread

Back
Top Bottom