|
-
Nov 20th, 2000, 04:16 PM
#1
Thread Starter
New Member
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
-
Nov 20th, 2000, 04:19 PM
#2
Lively Member
format should work
Code:
newdate = format(olddate, yyyymmdd)
this should work even if your variables are of string or date value.
H.
 Just trying to muddle through...
-
Nov 20th, 2000, 04:21 PM
#3
Lively Member
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.
 Just trying to muddle through...
-
Nov 20th, 2000, 04:25 PM
#4
_______
<?>
Code:
Private Sub Command1_Click()
Dim olddate As String
olddate = "11/20/00"
MsgBox Format(olddate, " yyyy/mm/dd")
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 21st, 2000, 03:55 AM
#5
Lively Member
Code:
public function formatDate(dateInput as variant) as string
If IsDate(dateInput) Then
formatDate = Format(dateInput, "yyyymmdd")
Else
formatDate = vbNullString
End If
end sub
validates and changes the format.
H.
 Just trying to muddle through...
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
|