Bug 21445

Summary: Report - having two date ranges in query creates a formatting issue when running report
Product: Koha Reporter: Todd Goatley <tgoatley>
Component: ReportsAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Screen shot of addressed issue

Description Todd Goatley 2018-09-27 18:47:36 UTC
When the report is run like the following query, the second half of the second date range does not display. 

SELECT borrowers.cardnumber, borrowers.surname, borrowers.firstname, borrowers.dateofbirth, borrowers.dateenrolled
FROM borrowers
WHERE dateofbirth BETWEEN <<Date of Birth BETWEEN (yyyy-mm-dd)|date>> AND << AND (yyyy-mm-dd)|date>> AND dateenrolled BETWEEN <<Enrollment Date BETWEEN (yyyy-mm-dd)|date>> AND <<and (yyyy-mm-dd)|date>> AND branchcode=<<Branch|branches>>
ORDER BY borrowers.surname ASC

Reformatting the query as follows all dates ranges display correctly.

SELECT
    borrowers.cardnumber,
    borrowers.surname,
    borrowers.firstname,
    borrowers.dateofbirth,
    borrowers.dateenrolled
FROM
    borrowers
WHERE
    dateofbirth BETWEEN <<Date of Birth BETWEEN (yyyy-mm-dd)|date>> AND << AND (yyyy-mm-dd)|date>> 
    AND dateenrolled BETWEEN <<Enrollment Date BETWEEN (yyyy-mm-dd)|date>> AND <<and (yyyy-mm-dd)|date>> 
    AND branchcode=<<Branch|branches>>
    ORDER BY
    borrowers.surname ASC
Comment 1 Todd Goatley 2018-09-27 18:50:17 UTC
Created attachment 79546 [details]
Screen shot of addressed issue
Comment 2 Katrin Fischer 2023-10-07 22:53:20 UTC
This works as intended. Variables with the exact same description are grouped into one input field. This allows us to re-use variables and is considered a feature.