Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I Dont like Sundays

Status
Not open for further replies.

Underling

MIS
Jul 30, 2002
17
AU
I know that somewhere out there the has to be a bit of code to kill off Sundays.
I am runing Access 2000.
I run the old =DateDff"[First Date][Second Date], and I get the number of days betten the two dates.
But we don't work weekends, so the answer to "number of days between Date"X" and Date"Y" might be 42 for example.
But I cant take out the weekend days to give the real number of days "31"

Anyone got a script?
 
Hi

If you look at Help on DateDiff() you will see that microsoft include a parameter to return working days (ie excluding weekends) rather than days "d" returns days, "w" (I think) returns working days Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
KenReay

If you look at Help on DateDiff()

is necessary for YOU

this 'rumor' apparently comes from exposure to excel.


Underling

see faq181-261. It IS a bit more than you are asking for, however it does include an approach to remove the pecific days of the week from a process which counts days between two dates. On the other hand, every time I have encountered this issue in the 'workplace', it has eventually (and usually sooner) devolved into excluding the Holiday dates as well as the designated week end days.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
"... it has eventually (and usually sooner) devolved into excluding the Holiday dates"

well, "devolved" is an interesting description of the situation, but yeah, that happens

bite the bullet, underling, and declare a Calendar table

see for an example

declare a "working hours" column and you can count half days (e.g. december 24 and 31 in most offices)

rudy
 
Thanks Guys, going to try it out and see how we go :)

Will let ya know how I get on.

Remember, be ever vigilant, the stupid is everywhere.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top