Bug 21445 - Report - having two date ranges in query creates a formatting issue when running report
Summary: Report - having two date ranges in query creates a formatting issue when runn...
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-27 18:47 UTC by Todd Goatley
Modified: 2024-07-04 20:38 UTC (History)
0 users

See Also:
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 (19.83 KB, image/png)
2018-09-27 18:50 UTC, Todd Goatley
Details

Note You need to log in before you can comment on or make changes to this bug.
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.