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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert text to date

Status
Not open for further replies.

vzachin

Technical User
Feb 10, 2006
305
0
0
US
hi,

i need help converting a text string to a date and then comparing that date to today's date.

the text string is formated as mmddyy eg:122209

thanks
zach
 


zach,

Check out DateSerial function...
Code:
dim MyDate as date

MyDate = DateSerial(Cint("20" & Mid("122209",5,2)),CINt(Mid("122209",1,2)),CInt(Mid("122209",3,2)))


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
thanks skip. i was looking the dateserial but wasn't sure how it worked

zach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top