Asp classic 在ASP中检索日期

Asp classic 在ASP中检索日期,asp-classic,Asp Classic,我想从日期(在文本框中)中检索飞蛾,然后 如果检索到的月份是一月,则必须添加一些函数 CurrDate =session("txtdateFrom") CurrMonthID=session("txtdateTo") CurrMonthName=MonthName("CurrMonthID") iF CurrMonthName=January /* This portion have error */ /* some functions */

我想从日期(在文本框中)中检索飞蛾,然后

如果检索到的月份是一月,则必须添加一些函数

CurrDate =session("txtdateFrom")
CurrMonthID=session("txtdateTo")
CurrMonthName=MonthName("CurrMonthID")


iF CurrMonthName=January                      /* This portion have error */

/*   some functions  */

else if CurrMonthName= February

/*  some functions */

MonthName
函数以字符串格式返回月份名称。因此,

If lcase(CurrMonthName) = "january" Then
....
else if lcase(CurrMonthName) = "february" Then
但是,我建议使用
Month
函数,该函数将返回您当月的号码。
因此,代码看起来像

dim monthNum=月份(myDate)


如果答案能解决你的问题,那就接受它吧。单击答案旁边的复选框图像以接受它。
if monthNum = 1 Then
....
else if monthNum = 2 Then