Re: [Koha] Set report sort order at runtime

2018-04-23 Thread Cab Vinton
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  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
___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


Re: [Koha] Set report sort order at runtime

2018-04-23 Thread Owen Leonard
> 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


[Koha] Set report sort order at runtime

2018-04-23 Thread Cab Vinton
Is this possible?

This code did not work:

ORDER BY <>

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
___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha