Searching for pairs of date/time values in a single row
I'm not sure of db2 syntax, but how about this?

-- declare your 4 variables
@START_ROSDAT
@STOP_ROSDAT
@START_ROSTIM
@STOP_ROSTIM

select  *
from    PHONELOGTABLE
where   (   @start_rosdat &lt;&gt; @stop_rosdat                                    -- search covers more than 1 day
           and  (       (ROSDAT &gt; @START_ROSDAT AND ROSDAT &lt; @STOP_ROSDAT)   -- catches all full days between start and stop
                   or   (ROSDAT = @START_ROSDAT AND ROSTIM &gt;= @START_ROSTIM) -- catches everything on the "start" day
                   or   (ROSDAT = @STOP_ROSDAT AND ROSTIM &lt;= @STOP_ROSTIM)   -- catches everything on the "stop" day
                )
        )
  or    (   @start_rosdat = @stop_rosdat                                     -- only search a single "day"
           and  (       (ROSDAT = @START_ROSDAT AND ROSTIM &gt;= @START_ROSTIM)
                   and  (ROSDAT = @STOP_ROSDAT AND ROSTIM &lt;= @STOP_ROSTIM)
                )
        )




WHERE condition simplified a bit (the parentheses are there only for clarity, you can safely remove them):

where   ( ROSDAT &gt; @start_rosdat   and  ROSDAT &lt; @stop_rosdat )

   or   (  @start_rosdat &lt; @stop_rosdat 
      and  ROSDAT = @start_rosdat  and  ROSTIM &gt;= @start_rostim )

   or   (  @start_rosdat &lt; @stop_rosdat 
      and  ROSDAT = @stop_rosdat   and  ROSTIM &lt;= @stop_rostim  )

   or   (  @start_rosdat = @stop_rosdat 
      and  ROSDAT = @start_rosdat  and  ROSTIM &gt;= @start_rostim
                                   and  ROSTIM &lt;= @stop_rostim  )




and another version (parentheses are needed here):

where   (  ROSDAT &gt; @start_rosdat  
       or  ROSDAT = @start_rosdat  and  ROSTIM &gt;= @start_rostim )

   and  (  ROSDAT &lt; @stop_rosdat
       or  ROSDAT = @stop_rosdat   and  ROSTIM &lt;= @stop_rostim  )