VBScript Month Name

Hi Experts,
The following returns the month as a number, e.g. 8 for August

<%=Request.Form("myMonth")%>

How could I display the month name instead of a number.

Thank you for your help
romsomIT DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontyWeb Ninja at largeCommented:
use the MonthName function() - http://www.w3schools.com/vbscript/func_monthname.asp

<%=MonthName( Request.Form("myMonth") )%>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
romsomIT DeveloperAuthor Commented:
Thank you very much Big Monty.
Nice to see you!
0
Big MontyWeb Ninja at largeCommented:
keep in mind if it's not a valid number, it'll through an error, so you may want to do some error checking:

<%
   monthNum = Request.Form("myMonth")
   if not isNumeric( monthNum ) then 
       monthNum = Month( Now )     '-- default to current month
    elseif monthNum < 1 or monthNum > 12 then
       monthNum = Month( Now )     '-- default to current month
   end if

Response.Write MonthName( monthNum )
%>

Open in new window

0
Big MontyWeb Ninja at largeCommented:
you're very welcome! have a swell weekend :)
0
romsomIT DeveloperAuthor Commented:
It's working fine because I submit from a dropdown where the month numbers are hard coded.
Have fun this weekend!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.