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

HELP Dates!!!!!!!!!!!!!!!!!!!!!!

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
I have a query which works out the average number of days of the records found between 2 dates. However I need this to be week days.

Is there anyay I can do this in a query without code.

Finding the number of week days between 2 dates in a query would do as a start.

Thanks [sig][/sig]
 
EscapeUK,

I don't believe this can be done w/o any code - however the code is pretty simple - and can be called from the query.

On the other hand, everywhere I have seen this requested, it has ended up wanting the holidays also removed as well as the weekends. This ALWAYS requires some special processing, as the holidays vary between locales. In general, the process uses a 'Table' which has only the holiday dates, and a routine which gets the start/end dates. It &quot;walks&quot; through the dates, checking the &quot;Weekday&quot; to assure that the date is a normal workday. If it is, it then needs to do the lookup on the holiday table, to check that if it is a designated Holiday. Obviously, it keeps a counter to total the number of workdays in the interval. [sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
Micheal

Ok fire away tell me all you know. Including the bit on how i call code from a query. I have also just found out that i will also be using a table that has hokidays in it.

thanks [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top