Hi All,
Anyone here please help me convery string value 111007 to date Data Type :11/oct/07
Thanks in Advance
NuFLaVoRs:)
Printable View
Hi All,
Anyone here please help me convery string value 111007 to date Data Type :11/oct/07
Thanks in Advance
NuFLaVoRs:)
I was solved the problem
This is my Solution, does anyone got better solution ?
Please post to let me know.
Thanks ya
vb Code:
Dim CdateVal As Date Dim StrVal As String StrVal = "111007" CdateVal = DateSerial(Mid(StrVal, 5, 2), Mid(StrVal, 3, 2), Mid(StrVal, 1, 2))
Quote:
Originally Posted by nUflAvOrS
Code:Dim dm As String, dt As Date
dm = "111007"
dt = Left(dm, 2) & "-" & Mid(dm, 3, 2) & "-" & Mid(dm, 5)
dt = Format("11-10-07", "dd/mmm/yyyy")
Thanks your solution,
I appreciated your help ^^
if your date doesn't have to be a date variable, you could use the format$ command
newstring$ = format$(olddate, "dd/mmm/yy")
i am currently reinstalling OS and i don't have vb installed right now so i can't remember for sure if it has to be converted to a long first.
Dear Sir Load Orwell ,
I had tried the solution you were provided, it return 04/Dec/03
a return value from format is not a date data type, a date data type is a date value, that is displayed as the setting in system locale (or a formatted string)Quote:
Anyone here please help me convery string value 111007 to date Data Type :11/oct/07
Your own solution is the best, as long as the string is always in this format.
Any output from the Format function is a string, and when assigned to a date variable, the output is dependent on you local settings. This is not acceptable.
Thx westconn1 and Frans C.
The Theory help me a lot...
I will mark this thread resolved.
Thanks you...