Hi,
I need to convert a date from mmddyy to yyyymmdd
I am converting a text file where the date is in mmddyy format I have to convert it to a yyyymmdd.
Please somebody help
I tried the format functon but it doesn't seem to work
Thanx
Printable View
Hi,
I need to convert a date from mmddyy to yyyymmdd
I am converting a text file where the date is in mmddyy format I have to convert it to a yyyymmdd.
Please somebody help
I tried the format functon but it doesn't seem to work
Thanx
format should work
this should work even if your variables are of string or date value.Code:newdate = format(olddate, yyyymmdd)
H.
I also have a small piece of code that will validate and convert a string to the format you are looking for.
I'll look it out for you.
H.
Code:Private Sub Command1_Click()
Dim olddate As String
olddate = "11/20/00"
MsgBox Format(olddate, " yyyy/mm/dd")
End Sub
validates and changes the format.Code:public function formatDate(dateInput as variant) as string
If IsDate(dateInput) Then
formatDate = Format(dateInput, "yyyymmdd")
Else
formatDate = vbNullString
End If
end sub
:D H.