tags:

views:

34

answers:

1

I want to retrieve the moth from a date(in textbox),then

If that retrieved month is January ,some functions have to be added.

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


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

/*   some functions  */

else if CurrMonthName= February

/*  some functions */
+1  A: 

MonthName function returns the name of the month in string format. Hence,

If lcase(CurrMonthName) = "january" Then
....
else if lcase(CurrMonthName) = "february" Then

However, I suggest using Month function that will return you the number for the month.
So, the code will look like

dim monthNum = Month(myDate)

if monthNum = 1 Then
....
else if monthNum = 2 Then
shahkalpesh