From 65ebd4874f971c52e10b48786b01f7c68c98df76 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Fri, 4 Oct 2019 14:31:22 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'); -- 2.11.0