Created
March 27, 2012 07:37
-
-
Save weipah/2213734 to your computer and use it in GitHub Desktop.
Wochenstart und -Ende anhand eines Datums bestimmen (Access VBA, Array)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Aufruf | |
Dim tage() As String | |
tage = getWeek(textbox.text) | |
Function getWeek(datum As String) As Variant | |
'Dim datum As String | |
Dim result(1) As String | |
Dim wochentag As Integer | |
Dim wStart As String | |
Dim wEnde As String | |
wochentag = Weekday(datum, vbMonday) | |
wStart = DateAdd("d", (wochentag - 1) * -1, datum) | |
wEnde = DateAdd("d", 7 - wochentag, datum) | |
result(0) = wStart | |
result(1) = wEnde | |
getWeek = result | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment