From: Chris Sharp Date: Fri, 4 Oct 2019 18:31:22 +0000 (-0400) Subject: LP#1846484 - Add BETWEEN SYMMETRIC to reporter SQL builder X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=65ebd4874f971c52e10b48786b01f7c68c98df76;p=Evergreen.git LP#1846484 - Add BETWEEN SYMMETRIC to reporter SQL builder Let's give end users a break and forgive them when they mix up the order of a date range. BETWEEN SYMMETRIC allows users to enter a date range in any order rather than strictly enforcing "oldest date first" and returning an empty result set. Signed-off-by: Chris Sharp Signed-off-by: Rogan Hamby Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm b/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm index d98a04fa25..0117d98bad 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm @@ -954,10 +954,10 @@ sub toSQL { $sql .= '('. $self->SUPER::toSQL ." IS NOT NULL AND ". $self->SUPER::toSQL ." <> '')"; } elsif (lc($op) eq 'between') { - $sql .= " BETWEEN ". join(" AND ", map { $_->toSQL } @$val); + $sql .= " BETWEEN SYMMETRIC ". join(" AND ", map { $_->toSQL } @$val); } elsif (lc($op) eq 'not between') { - $sql .= " NOT BETWEEN ". join(" AND ", map { $_->toSQL } @$val); + $sql .= " NOT BETWEEN SYMMETRIC ". join(" AND ", map { $_->toSQL } @$val); } elsif (lc($op) eq 'like') { $val = $$val[0] if (ref($val) eq 'ARRAY');