Thread: datediff
View Single Post
  #2 (permalink)  
Old July 28th, 2006, 09:42 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

This is a problem I have found with VBA. In the MSDN refernce for the DateDiff Function, MS refernces "w" as the interval to use for "Weekday." However, w returns the weeks.

What I have done is to take each date, check its day of the week value, if it is between 2 and 6, add 1 to a variable, and then display the total. This wouldn't help much in a query. Perhaps you can create a function that does this when the fields in your table are updated, and actually store the values in the table.

I have written the function if you want to use it.

HTH


mmcdonal