[AccessD] difference in days

paul.hartland at fsmail.net paul.hartland at fsmail.net
Fri Oct 20 06:42:25 CDT 2006


Pedro,

I think you would have to use the function (or similar) that you can get from the Access Web, see below:

'************* Code Start *************
Public Function HowManyWeekDay(FromDate As Date, _
                            ToDate As Date, _
                            Optional ToDateIsIncluded As Boolean = True)
    
    HowManyWeekDay = DateDiff("d", FromDate, ToDate) - _
                    ToDateIsIncluded - _
                    HowManyWD(FromDate, ToDate, vbSunday) - _
                    HowManyWD(FromDate, ToDate, vbSaturday)
End Function
'************* Code End *************

Paul Hartland





Message Received: Oct 20 2006, 12:14 PM
From: pedro at plex.nl
To: accessd at databaseadvisors.com
Cc: 
Subject: [AccessD] difference in days

Hallo Group,

i used the following sql to calculate the difference between two dates.

SELECT Datum.Rapnaam, DateDiff("d",[DatOnt],[DatScr]) AS verschil
FROM Datum;

but i forgot that i only need the difference in workingdays, without the weekends. 

Is there a way to adjust the sql?

Pedro Janssen

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





Paul Hartland 
paul.hartland at fsmail.net 
07730 523179


More information about the AccessD mailing list