汽柴油零售价格:求教VB的日期函数

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 02:41:44
vb中有没有一个函数可自动显示出指定月份的最后一天呢?
比如我想知道 8月的最后一天
注明:不是我不知道8月31天。想用程序实现
谢谢了

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