I can have a var=12/05/09 or 11/02/08...
how to format in YYYY only the last 2 character of var...?
In this case:
12/05/2009
11/02/2008
Printable View
I can have a var=12/05/09 or 11/02/08...
how to format in YYYY only the last 2 character of var...?
In this case:
12/05/2009
11/02/2008
Is "var=12/05/09" in string format, or a date format?
Use Format mfunction:
Code:Private Sub Command1_Click()
Debug.Print Format(CDate("12/05/09"), "mm/dd/yyyy")
Debug.Print Format(CDate("11/02/08"), "mm/dd/yyyy")
End Sub