DB2 timestamp format

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.
 
J

Joel

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top