Dear Friends,
I have a string dS = "2005-04-21" and I want to convert it to a date variable in order to proceed with date functions.
How can I perform this operation?
Thank you in advance.
G.
Dear Friends,
I have a string dS = "2005-04-21" and I want to convert it to a date variable in order to proceed with date functions.
How can I perform this operation?
Thank you in advance.
G.
The easiest way is to use declared variables, when Excel handles the conversion automatically :-
Please Login or Register to view this content.
Regards
BrianB
Most problems are caused by starting from the wrong place.
Use a cup of coffee to speed up all Windows processes.
It's easy until you know how.
-----------------------------------------
Hello Banavas,
To convert the string to a Date type, use the CDate() function. This will convert any valid date string format into a Date Data Type. This function is also internationally aware.
Convert a String into a Date Type:
Dim MyDate As Date
MyDate = CDate("2005-04-21")
Sincerely,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks