Støv, fibre og metalliske partikler kan påvirke både uptime, levetid og driftssikkerhed. Derfor arbejder flere datacentre systematisk med contamination control.
Hvis du laver en tabel kaldet "Helligdage" med kun en kolonne. Denne kolonne skal hedde "Dato" og være af datatypen Dato/Tid
Herefter indsætter du disse 2 funktioner i et modul:
Public Function Arbejdsdag(Dato As Date) As Boolean If Weekday(Dato) = 7 Or Weekday(Dato) = 1 Then Arbejdsdag = False ElseIf DCount("*", "Helligdage", "Dato = #" & Format(Dato, "yyyy-mm-dd") & "#") > 0 Then Arbejdsdag = False Else Arbejdsdag = True End If End Function
Public Function FindAntalArbejdsdage(Startdato As Date, Slutdato As Date) As Long Dim tmpDato As Date Dim n As Integer tmpDato = Startdato Do Until tmpDato >= Slutdato If Arbejdsdag(tmpDato) Then n = n + 1 End If tmpDato = tmpDato + 1 Loop FindAntalArbejdsdage = n End Function
Herefter kan du finde antal arbejdedage ved at spørge f.eks.: Public Function Arbejdsdag(Dato As Date) As Boolean If Weekday(Dato) = 7 Or Weekday(Dato) = 1 Then Arbejdsdag = False ElseIf DCount("*", "Helligdage", "Dato = #" & Format(Dato, "yyyy-mm-dd") & "#") > 0 Then Arbejdsdag = False Else Arbejdsdag = True End If End Function
Public Function FindAntalArbejdsdage(Startdato As Date, Slutdato As Date) As Long Dim tmpDato As Date Dim n As Integer tmpDato = Startdato Do Until tmpDato >= Slutdato If Arbejdsdag(tmpDato) Then n = n + 1 End If tmpDato = tmpDato + 1 Loop FindAntalArbejdsdage = n End Function FindAntalArbejdsdage(Dato1;Dato2)
sorry....fik åbenbart indsat koden 2 gange. Her kommer indlægget igen:
Hvis du laver en tabel kaldet "Helligdage" med kun en kolonne. Denne kolonne skal hedde "Dato" og være af datatypen Dato/Tid
Herefter indsætter du disse 2 funktioner i et modul:
Public Function Arbejdsdag(Dato As Date) As Boolean If Weekday(Dato) = 7 Or Weekday(Dato) = 1 Then Arbejdsdag = False ElseIf DCount("*", "Helligdage", "Dato = #" & Format(Dato, "yyyy-mm-dd") & "#") > 0 Then Arbejdsdag = False Else Arbejdsdag = True End If End Function
Public Function FindAntalArbejdsdage(Startdato As Date, Slutdato As Date) As Long Dim tmpDato As Date Dim n As Integer tmpDato = Startdato Do Until tmpDato >= Slutdato If Arbejdsdag(tmpDato) Then n = n + 1 End If tmpDato = tmpDato + 1 Loop FindAntalArbejdsdage = n End Function
Herefter kan du finde antal arbejdedage ved at spørge f.eks.: FindAntalArbejdsdage(Dato1;Dato2)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.