查找月份的最后一天

发表于:2007-06-21来源:作者:点击数: 标签:
In many industries (particularly in the insurance industry), it注释:s import ant to know the last day of the month. To find the last day of a given month, add a text box and a command button to a form. Enter the following code in the comm

   
  In many industries (particularly in the insurance industry), it注释:s important to know the last day of the month. To find the last day of a given month, add a text box and a command button to a form. Enter the following code in the command button:


Dim TEMP2 As Date
Dim nLastDay As Integer
TEMP2 = InputBox$("Please Enter A Date", "LastDay")
nLastDay = DatePart("d", DateAdd("M", 1, TEMP2 - DatePart("d", TEMP2)))
Text1.Text = nLastDay
When you run the application and click the button, you注释:ll be prompted for a date. Then, the program will display the last day of that month of any year.

原文转自:http://www.ltesting.net