Click to See Complete Forum and Search --> : Character Shift assignment


jacknbey
08-03-2005, 08:23 AM
Hi,

I try to assign the following:-

"1AUG2005"

into:-

day = 1
month = AUG
year = 2005

since the day is either 1 or 2 characters in length and month is always in 3 character code I think it could be parse from the right handside.

Cannot find the SHIFT equivalent command. Anyone can share some knowledge how to do this?

Thanks a lot.

lmf232s
08-03-2005, 05:50 PM
I just threw this together so its not the best but maybe it will open your mind to other ways.


Dim GetYear
Dim strYear
Dim GetMonth
Dim strMonth
Dim GetDay
Dim strDay

GetYear = "1AUG2005"

strYear = Right(GetYear,4)
GetMonth = Split(GetYear, strYear)
strMonth = Right(GetMonth(0),3)
GetDay = Split(GetMonth(0),strMonth)
strDay = GetDay(0)

Response.Write strYear & "<BR>"
Response.Write strMonth & "<BR>"
Response.Write strDay & "<BR>"

jacknbey
08-03-2005, 10:29 PM
Thank you very much, works beautifully. :)