select ... from ... where the_date between dateadd(ss, -$seconds, $start_date) and dateadd(ss, $seconds, $end_date)