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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate the Number of days

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a query that calculates the number of days "something" took. in the query it's

Total Days: [thisfield] - [thisfield]

I want the query not to count saturday and sunday. in my criteria i tryed

Not Like 1 And Not Like 7

It doesnt seem to work. Can someone help me with the Criteria..

Thanks Alot DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Also try this link.


There should be an attachment which will also remove holidays.

change the last line to
funWorkDaysDifference = (lngTotalDays - lngTotalHolidays) - 1

If not the first day will include the start date.
25/9/2001 to 28/9/2001 would = 4
changing the last line to the above
25/9/2001 to 28/9/2001 would = 3

HTH
:)
David
 
Have you used this module?? it looks like the date fields have to start with dt?? how can i get around it?..when i use it in a query it returns all 0's.

Thanks DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

The line below is the one that shows up in the query.

funWorkDaysDifference («dtStartDay», «dtendday»)

Your start date field would go into dtStartDay
and your end date field would go into dtendday.

Does this help !!

:)
David

p.s. have you created a holidays table.





 
or (again) FAQ181-291 from right here at Tek-Tips.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Yes. You have found it!!

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top