if month1=4 and day1=31 then
day1=30
end if
if month1=6 and day1=31 then
day1=30
end if
if month1=9 and day1=31 then
day1=30
end if
if month1=11 and day1=31 then
day1=30
end if
sql="select datepart(day,convert(datetime,'"&str10&"')-1) as date1"
set date1=objConn.Execute(sql)
if month1=2 and day1>date1("date1") then
set day1=date1("date1")
end if
Sub GetYear(TempVal)
Dim i
Response.Write "年<select name="&Chr(34)&"year"&Chr(34)&">"&Chr(13)
For i=BeginYear To EndYear
If TempVal<>"" Then
If Cstr(TempVal)=CStr(i) Then
Response.Write "<option selected value="&Chr(34)&CStr(TempVal)&Chr(34)&">"&CStr(i)&"</option>"&Chr(13)
Else
Response.Write "<option value="&Chr(34)&CStr(i)&Chr(34)&">"&CStr(i)&"</option>"&Chr(13)
End If
Else
If Cstr(Year(Date()))=CStr(i) Then
Response.Write "<option selected value="&Chr(34)&CStr(i)&Chr(34)&">"&CStr(i)&"</option>"&Chr(13)
Else
Response.Write "<option value="&Chr(34)&CStr(i)&Chr(34)&">"&CStr(i)&"</option>"&Chr(13)
End If
End If
Next
Response.Write "</select>"&Chr(13)
End Sub
Sub GetMonth(TempVal)
Dim i,j
Response.Write "月<select name="&Chr(34)&"month"&Chr(34)&" onchange=frm.submit()>"&Chr(13)
For i=1 To 12
j=Right("0"&i,2)
If TempVal<>"" Then
If Cstr(TempVal)=CStr(j) Then
Response.Write "<option selected value="&Chr(34)&CStr(TempVal)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
Else
Response.Write "<option value="&Chr(34)&CStr(j)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
End If
Else
If Cstr(Month(Date()))=CStr(i) Then
Response.Write "<option selected value="&Chr(34)&CStr(j)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
Else
Response.Write "<option value="&Chr(34)&CStr(j)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
End If
End If
Next
Response.Write "</select>"&Chr(13)
End Sub
Sub GetDay(TempVal)
Dim i,j
Response.Write "日<select name="&Chr(34)&"day"&Chr(34)&">"&Chr(13)
For i=1 To DayNum()
j=Right("0"&i,2)
If TempVal<>"" Then
Response.Write "<option value="&Chr(34)&CStr(j)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
Else
If CStr(Day(Date()))=CStr(i) Then
Response.Write "<option selected value="&Chr(34)&CStr(j)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
Else
Response.Write "<option value="&Chr(34)&CStr(j)&Chr(34)&">"&CStr(j)&"</option>"&Chr(13)
End If
End If
Next
Response.Write "</select>"&Chr(13)
End Sub
Function DayNum()
Dim TempYear,TempMonth,TempVal
If TheYear="" Then
TempYear=CStr(Year(Date()))
Else
TempYear=TheYear
End If
If TheMonth="" Then
TempMonth=CStr(Month(Date()))
Else
If Cstr(Left(TheMonth,1))="0" Then
TempMonth=Right(TheMonth,1)
Else
TempMonth=TheMonth
End If
End If
BeginDate=CStr(TempYear)&"-"&CStr(TempMonth)&"-1"
If CInt(TempMonth)>11 Then
TempVal=1
TempYear=CInt(TempYear)+1
Else
TempVal=CInt(TempMonth)+1
End If
EndDate=CStr(TempYear)&"-"&CStr(TempVal)&"-1"
DayNum=DateDiff("d",BeginDate,EndDate)
End Function