Question Locked

DB2 timestamp fields

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to compare two time stamp fields on two diffrent tables. I need to have the first entry on table b that is greater than the entry on table a that I am comparing.

so if table a's time stamp entry is 2007-5-25.10.57.23.000001 and table b has 4 entries
2007-5-25.09.57.23.000001
2007-5-25.10.59.23.000001
2007-5-25.11.57.23.000001
2007-5-25.12.57.23.000001

I only want this entry 2007-5-25.10.59.23.000001
which is the next greatest time.

2 replies

by tony hopkinson

Select Min(MyTmeStamp) From
(Select MyTimeStamp From MyTimeStamps Where MyTimeStamp > ?) dummyresult

should work

This discussion is closed to new replies.