Summary: | Allow custom parameters for sorting in SQL reports | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Reports | Assignee: | Galen Charlton <gmcharlt> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | bibliwho, blawlor, kebliss, mspinney |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
Description
Katrin Fischer
2011-12-08 13:39:32 UTC
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 |