filtering record strings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have imported data from an xml audit dump provided to me by a certain
application. The format of the date time is this; 20070513232538. I need (in
access 2003) to translate this to date 2007/05/13 time 2325 the rest of the
chracters are irrelevant. Is there any expression I can use to accomplish
this?

Thanks
 
I have imported data from an xml audit dump provided to me by a certain
application. The format of the date time is this; 20070513232538. I need (in
access 2003) to translate this to date 2007/05/13 time 2325 the rest of the
chracters are irrelevant. Is there any expression I can use to accomplish
this?

Thanks


I think you're going to have to just parse it using MID and
DateSerial.
Year = CInt(left(MyDate,4))
Month=Cint(mid$(MyDate,5,2))
Day=Cint(Mid$(MyDate,7,2)
Hour=Cint(Mid$(MyDate,9,2))
MinuteCint(Mid$(MyDate,11,2))

Then put all that together to create the date... DateSerial...?
 
You might try the following (although this will keep the seconds)

CDate(Format([TheField],"@@@@\-@@\-@@\ @@\:@@\:@@"))

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top