|
-
Mar 15th, 2006, 08:32 AM
#1
Thread Starter
New Member
converting month string to number
Hi all
Im trying to find an easyer way to write this code
Function Convert_Date_Str2Int(Date_Str As String) As Integer
Select Case Date_Str
Case "January"
Convert_Date_Str2Int = 1
Case "February"
Convert_Date_Str2Int = 2
Case "March"
Convert_Date_Str2Int = 3
Case "April"
Convert_Date_Str2Int = 4
Case "May"
Convert_Date_Str2Int = 5
Case "June"
Convert_Date_Str2Int = 6
Case "July"
Convert_Date_Str2Int = 7
Case "August"
Convert_Date_Str2Int = 8
Case "September"
Convert_Date_Str2Int = 9
Case "October"
Convert_Date_Str2Int = 10
Case "November"
Convert_Date_Str2Int = 11
Case "December"
Convert_Date_Str2Int = 12
End Select
End Function
its long and messey and im sure there is an easyer way to do it
also is there a way to do the opposite comvert a month number to a string..
Thanks ed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|