We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Check if a Date Range Overlaps another Date Range — Vertica Forum

Check if a Date Range Overlaps another Date Range

Jim Knicely authored this tip.

The OVERLAPS Vertica built-in function evaluates two time periods and returns true when they overlap, false otherwise.

Example:

dbadmin=> SELECT (DATE '2018-04-18', DATE '2018-04-21') OVERLAPS (DATE '2018-04-16', DATE '2018-04-19');
 overlaps
----------
t
(1 row)

dbadmin=> SELECT (DATE '2018-04-18', DATE '2018-04-21') OVERLAPS (DATE '2018-04-22', DATE '2018-04-25');
 overlaps
----------
f
(1 row)

Have Fun!

Sign In or Register to comment.