Is this possible? This code did not work: ORDER BY <<Sorted by (dateaccessioned, itemcallnumber)>> as SQL turned this into: ORDER BY 'itemcallnumber' Think this would be a useful feature if Koha will allow it. Thanks in advance for any guidance, Cab Vinton, Director Plaistow Public Library Plaistow, NH
as SQL turned this into:
ORDER BY 'itemcallnumber'
As you have discovered, Koha will try to put your strings into quotes on the assumption that you're submitting something for some kind of matching purposes. I agree that it would be a nice option for parameters. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
Thanks, Owen. Some quick Googling turned up several solutions that rely on setting a variable & then using CASE WHEN syntax. Tried this but Koha threw an error on the SET statement :-( SET @OrderByColumn = 'AddedDate' . ORDER BY CASE WHEN @OrderByColumn='AddedDate' THEN CONVERT(varchar(50),AddedDate) WHEN @OrderByColumn='Visible' THEN CONVERT(varchar(2), Visible) WHEN @OrderByColumn='AddedBy' THEN AddedBy WHEN @OrderByColumn='Title' THEN Title END Ah well. On Mon, Apr 23, 2018 at 9:31 AM, Owen Leonard <oleonard@myacpl.org> wrote:
as SQL turned this into:
ORDER BY 'itemcallnumber'
As you have discovered, Koha will try to put your strings into quotes on the assumption that you're submitting something for some kind of matching purposes.
I agree that it would be a nice option for parameters.
-- Owen
-- Web Developer Athens County Public Libraries http://www.myacpl.org _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
participants (2)
-
Cab Vinton -
Owen Leonard