🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Dni robocze ...

#137458
From: Krzysiek ZULUS
Date: Tue, 16 May 2017 05:54
64 lines
3553 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
Technical Details
Message-ID: <4318f42c-e32d-44c2-9589-ce6896b05b8b@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!67no312292itx.0!news-out.google.com!v18ni4139ita.0!nntp.google.com!67no309064itx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <60168896-416e-4f0e-bbc9-f65e8b146b0c@googlegroups.com> <591a8706$0$15201$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
X-Received: by 10.107.144.130 with SMTP id s124mr4577770iod.4.1494914083957;        Mon, 15 May 2017 22:54:43 -0700 (PDT)
X-Received: by 10.157.34.229 with SMTP id y92mr201136ota.15.1494914083927; Mon, 15 May 2017 22:54:43 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!67no312292itx.0!news-out.google.com!v18ni4139ita.0!nntp.google.com!67no309064itx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.bazy-danych.msaccess
Date: Mon, 15 May 2017 22:54:43 -0700 (PDT)
In-Reply-To: <591a8706$0$15201$65785112@news.neostrada.pl>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.23.151.200; posting-account=QXa8DAoAAADLyZC0nhuBrkyBjEj_3WOt
NNTP-Posting-Host: 185.23.151.200
References: <60168896-416e-4f0e-bbc9-f65e8b146b0c@googlegroups.com> <591a8706$0$15201$65785112@news.neostrada.pl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4318f42c-e32d-44c2-9589-ce6896b05b8b@googlegroups.com>
Subject: Re: Dni robocze ...
From: Krzysiek ZULUS <krzysztof.janusz@delkar.pl>
Injection-Date: Tue, 16 May 2017 05:54:43 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit