DB2 timestamp format

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

Can Excel calculate date/time difference with data in DB2 timestamp format?
DB2's timestamp format is yyyy-mm-dd-hh.mm.ss.mmmmmm. i could probably write
some code but i was hoping not to.
 
Are both dates dates serial dates (Numbers) or strings? If they are both
numbers then you should be able to compare the number. If they are strings
then you need to convert using datavalue

MyDate = DateValue("2008-05-20 12.01.23")

You will have to replace the dash between the date and time with a blank a
remove the 6 digits at the end

D2Time = "yyyy-mm-dd-hh.mm.ss.mmmmmm"
D2Time = Left(D2Time, 10) & " " & Mid(D2Time, 12, 8)

MyDate = DateValue(D2Time)
 
Back
Top