[Koha-bugs] [Bug 7335] Allow custom parameters for sorting in sql reports

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jun 6 18:02:25 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7335

Cab Vinton <bibliwho at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bibliwho at gmail.com

--- Comment #1 from Cab Vinton <bibliwho at gmail.com> ---
This is a bit kludgy, but I believe it works:

Report for patrons w/ emails:

SELECT cardnumber, surname, firstname, email, dateexpiry, dateenrolled
FROM borrowers
WHERE email IS NOT NULL AND email!= ''
ORDER BY CASE WHEN @SortOrder:=<<Search order>> = 'dateexpiry' THEN dateexpiry
              WHEN @SortOrder= 'cardnumber' THEN cardnumber
         END

Official column names have to be used rather than something more user-friendly,
but otherwise it's

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list