View Full Version : extract dates from string


madrav72
01-11-2006, 12:08 PM
how can i extract the two times from the following string ??


Free slot start: 13:30:00 End of Free slot: 15:00:00

i need to be able to store both times as in date type form

Matt Greatorex
01-11-2006, 12:20 PM
If the starting format is always going to be the same:

Right(string, 8) will return the '15:00:00' part

Right(Left(string, 25),8) should return the '13:30:00' part

Bat17
01-11-2006, 11:01 PM
Right(Left(string, 25),8) should return the '13:30:00' part
Maybe even
Mid(string, 17, 8) :)

To force it to a date/time use cDate()

CDate(Mid(string, 17, 8))

HTH

Peter