| 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 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
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
|