TKSoft-Online

Anzahl der Tage im Monat PDF Drucken E-Mail
( 0 Votes )
MS-Access Codes - Codeschnipsel Datum/Zeit
  
Donnerstag, den 27. Dezember 2007 um 01:00 Uhr

Problemstellung:

Wie kann ich aus einem Datum die Anzahl der Tage des Monats ermitteln?

 


Public Function DaysInMonth(dateDatum As Date) As Integer
  If VarType(dateDatum) <> 7 Then
    DaysInMonth = Null
  Else
    DaysInMonth = DateSerial(Year(dateDatum), Month(dateDatum) + 1, 1) - _
                  DateSerial(Year(dateDatum), Month(dateDatum), 1)
  End If
End Function

Aufruf:


Dim x As Integer
x =DaysInMonth(#02.04.2004#)

Das Ergebnis wäre x = 30

DatumKlicks
Total1565
Di. 222
Mo. 213
So. 202
Sa. 193
Fr. 182
Do. 171
Mi. 162
Aktualisiert ( Freitag, den 02. Juli 2010 um 08:39 Uhr )
 

Kommentar schreiben


Sicherheitscode
Aktualisieren

Login

Latest Comments

Latest Forum Posts

Mehr »

Download Statistik

41 Kategorien
187 Dateien
173416 Downloads