Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Convert Date to string ????

Status
Not open for further replies.

Dylan

MIS
Aug 27, 1998
109
US
I would like to convert a date type to a string in order to extract a 2 char month and 2 character year.

Input:
01/12/00 date type

Output:
01 2 char string month with leading 0 if appplicable
00 2 char string year with leading 0 if appplicable

Thanks for any help ...
 
doing this without testing or looking over past uses and I may be screwed up.
d1$=left$(date$,2):d2$=mid$(date$,4,2) should give current date. sub your variable in place of date$ should extract. you may need to test for length of your variable to see if you have the right length, add a zero to the front if you are one short.

Ed Fair
efair@atlnet.com

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top