🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.bazy-danych.msaccess
Article #133918

Re: Dni robocze ...

#133918
From: Krzysiek ZULUS
Date: Mon, 15 May 2017 22:54
64 lines
2288 bytes
Dziękuję :-)

> proponuje takie rozwiazanie:
> 
> Function czy_swieto(dzien As Date) As Boolean
> On Error GoTo blad
> 
>                  If _
>                      Weekday(dzien, vbMonday) = 7 Or _
>                      Weekday(dzien, vbMonday) = 6 Or _
>                      Month(dzien) = 1 And Day(dzien) = 1 Or _
>                      Month(dzien) = 1 And Day(dzien) = 6 Or _
>                      Month(dzien) = 5 And Day(dzien) = 1 Or _
>                      Month(dzien) = 5 And Day(dzien) = 3 Or _
>                      Month(dzien) = 8 And Day(dzien) = 15 Or _
>                      Month(dzien) = 11 And Day(dzien) = 1 Or _
>                      Month(dzien) = 11 And Day(dzien) = 11 Or _
>                      Month(dzien) = 12 And Day(dzien) = 25 Or _
>                      Month(dzien) = 12 And Day(dzien) = 26 Or _
>                      dzien = Wielkanoc(Year(dzien)) Or _
>                      dzien = Wielkanoc(Year(dzien)) + 59 _
>                  Then
>                      czy_swieto = True
>                  Else
>                      czy_swieto = False
>                  End If
> 
> wyjscie:
>      DoCmd.SetWarnings -1
>      Exit Function
> blad:
>      MsgBox Err.Description, vbCritical, "Błąd " & Err.Number
>      Resume wyjscie
> End Function
> 
> 
> 
> Public Function Wielkanoc(rok As Integer) As Date
> Dim a As Integer, b As Integer, c As Integer, D As Integer, e As 
> Integer, f As Integer, g As Integer, h As Integer, i As Integer, l As 
> Integer, M As Integer, p As Integer, n As Integer, k As Integer
> 
>          a = rok Mod 19
>          b = Int(rok / 100)
>          c = rok Mod 100
>          D = Int(b / 4)
>          e = b Mod 4
>          f = Int((b + 8) / 25)
>          g = Int((b - f + 1) / 3)
>          h = (19 * a + b - D - g + 15) Mod 30
>          i = Int(c / 4)
>          k = c Mod 4
>          l = (32 + 2 * e + 2 * i - h - k) Mod 7
>          M = Int((a + 11 * h + 22 * l) / 451)
>          p = (h + l - 7 * M + 114) Mod 31
>          p = p + 1
>          n = Int((h + l - 7 * M + 114) / 31)
> 
> 'poniedziałek
>     Wielkanoc = DateSerial(rok, n, p + 1)
> 
> End Function
> 
> md

Message-ID: <4318f42c-e32d-44c2-9589-ce6896b05b8b@googlegroups.com>
Path: polish.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail
References: <60168896-416e-4f0e-bbc9-f65e8b146b0c@googlegroups.com> <591a8706$0$15201$65785112@news.neostrada.pl>