Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

storing the date in a variable

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have the following code which I want to store the month number in the variable but doesn't work. Like today that variable would store 8 in it. How would I do this??

Dim today as string
today = month(date())
 
try

Dim strToday as String
strToday = DateTime.Now.Month

hth Daren J. Lahey
Just another computer guy...
 
I believe the Month(Date) returns an integer. I would put something like:

Dim k As integer
k = Month(Now)

...Alcar's solution is perfect for a string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top