date

  • Thread starter Thread starter Schuco
  • Start date Start date
S

Schuco

How to find last date in the month? If I put number 1 in one text box I
would like to see 31.01.2003 in another text box and so on.

Does anyone know how to do that?

Regards,
Schuco
 
Hi Schuco

The function that follows should do it for you.

Best regards

Maurice

--------------------------------------
Public Function fDatEomDat(dDate As Date) As Date
' Function returns last day of month (EOM) from passed date
' ie. #02/05/2001# returns #02/28/2001#
fDatEomDat = DateSerial(Year(dDate), Month(dDate) + 1, 1) - 1
End Function
 
Thank you very much!

/Schuco


StCyrM said:
Hi Schuco

The function that follows should do it for you.

Best regards

Maurice

--------------------------------------
Public Function fDatEomDat(dDate As Date) As Date
' Function returns last day of month (EOM) from passed date
' ie. #02/05/2001# returns #02/28/2001#
fDatEomDat = DateSerial(Year(dDate), Month(dDate) + 1, 1) - 1
End Function
 
Back
Top