Datediff function

  • Thread starter Thread starter Amazing
  • Start date Start date
A

Amazing

Hi,

I am trying to write a query that gives the number of working days
between two dates so I can calculate transit time for some shipping
based on working days. I have used the following expression:

Expres1: DateDiff('w',[Date],[DateDeliver])

But the results only gives me zeros for date combinations such as date
15/2/06 and date delivered of 16/2/06.

What am I doing wrong ?
 
From Online Help:
When interval is Weekday ("w"), DateDiff returns the number of weeks
between the two dates. If date1 falls on a Monday, DateDiff counts the
number of Mondays until date2. It counts date2 but not date1. If
interval is Week ("ww"), however, the DateDiff function returns the
number of calendar weeks between the two dates. It counts the number of
Sundays between date1 and date2. DateDiff counts date2 if it falls on a
Sunday; but it doesn't count date1, even if it does fall on a Sunday.

Not sure why - but there you go. Suggest writing your own simple
function that could also take care of public holidays and/or could make
use of a holiday table.
 
Back
Top