How to add authorized value to a report output

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add authorized value to a report output

Joelle Hannert
I'm trying to get a report to include an output of a custom borrower
attribute, but having trouble coming up with the correct way to ask for
this in the SQL code. I feel like the answer is somewhere on this schema
page:
http://schema.koha-community.org/18_11/tables/borrower_attributes.html  but
nothing I'm trying is working. The authorized value for our local attribute
is "BANNERHOLD."
I tried the following:

   - borrower_attributes.bannerhold
   - borrower_attribute_types.bannerhold
   - code.bannerhold

I don't really understand how the relationships work, so it's just trial
and error for me. Any advice would be much appreciated!

Joelle

--
Joelle Hannert
Library Technical Services Coordinator
Northwestern Michigan College
(231) 995-1684
Work days: M, W, Th, F
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: How to add authorized value to a report output

Stephen Graham
Joelle - something like:

select  * from borrower_attributes where code = ' BANNERHOLD '

? Does that identify the records you are interested in? or is the bannerhold value the attribute? If so, then:

select  * from borrower_attributes where attribute = ' BANNERHOLD '

?

Stephen

-----Original Message-----
From: Koha <[hidden email]> On Behalf Of Joelle Hannert
Sent: 06 March 2020 15:11
To: Koha <[hidden email]>
Subject: [Koha] How to add authorized value to a report output

I'm trying to get a report to include an output of a custom borrower attribute, but having trouble coming up with the correct way to ask for this in the SQL code. I feel like the answer is somewhere on this schema
page:
http://schema.koha-community.org/18_11/tables/borrower_attributes.html  but nothing I'm trying is working. The authorized value for our local attribute is "BANNERHOLD."
I tried the following:

   - borrower_attributes.bannerhold
   - borrower_attribute_types.bannerhold
   - code.bannerhold

I don't really understand how the relationships work, so it's just trial and error for me. Any advice would be much appreciated!

Joelle

--
Joelle Hannert
Library Technical Services Coordinator
Northwestern Michigan College
(231) 995-1684
Work days: M, W, Th, F
_______________________________________________

Koha mailing list  http://koha-community.org [hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: How to add authorized value to a report output

rogan
In reply to this post by Joelle Hannert
Hi Joelle,

For the linking between borrower and borrower attributes you want to say
which borrower attribute you want via the code and you may want to specify
the value like this:

 select b.cardnumber from borrowers b join borrower_attributes ba on
ba.borrowernumber = b.borrowernumber where ba.code = 'BANNERHOLD' and
ba.attribute = 'YES';



On Fri, Mar 6, 2020 at 10:12 AM Joelle Hannert <[hidden email]> wrote:

> I'm trying to get a report to include an output of a custom borrower
> attribute, but having trouble coming up with the correct way to ask for
> this in the SQL code. I feel like the answer is somewhere on this schema
> page:
> http://schema.koha-community.org/18_11/tables/borrower_attributes.html
> but
> nothing I'm trying is working. The authorized value for our local attribute
> is "BANNERHOLD."
> I tried the following:
>
>    - borrower_attributes.bannerhold
>    - borrower_attribute_types.bannerhold
>    - code.bannerhold
>
> I don't really understand how the relationships work, so it's just trial
> and error for me. Any advice would be much appreciated!
>
> Joelle
>
> --
> Joelle Hannert
> Library Technical Services Coordinator
> Northwestern Michigan College
> (231) 995-1684
> Work days: M, W, Th, F
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> [hidden email]
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: How to add authorized value to a report output

Joelle Hannert
Sorry, I should have been more clear. I'm not trying to select on the
BANNERHOLD status (YES/NO/blank), I just want the contents of that field to
be included in the report output for each patron reported.

On Fri, Mar 6, 2020 at 10:29 AM <[hidden email]> wrote:

> Hi Joelle,
>
> For the linking between borrower and borrower attributes you want to say
> which borrower attribute you want via the code and you may want to specify
> the value like this:
>
>  select b.cardnumber from borrowers b join borrower_attributes ba on
> ba.borrowernumber = b.borrowernumber where ba.code = 'BANNERHOLD' and
> ba.attribute = 'YES';
>
>
>
> On Fri, Mar 6, 2020 at 10:12 AM Joelle Hannert <[hidden email]> wrote:
>
>> I'm trying to get a report to include an output of a custom borrower
>> attribute, but having trouble coming up with the correct way to ask for
>> this in the SQL code. I feel like the answer is somewhere on this schema
>> page:
>> http://schema.koha-community.org/18_11/tables/borrower_attributes.html
>> but
>> nothing I'm trying is working. The authorized value for our local
>> attribute
>> is "BANNERHOLD."
>> I tried the following:
>>
>>    - borrower_attributes.bannerhold
>>    - borrower_attribute_types.bannerhold
>>    - code.bannerhold
>>
>> I don't really understand how the relationships work, so it's just trial
>> and error for me. Any advice would be much appreciated!
>>
>> Joelle
>>
>> --
>> Joelle Hannert
>> Library Technical Services Coordinator
>> Northwestern Michigan College
>> (231) 995-1684
>> Work days: M, W, Th, F
>> _______________________________________________
>>
>> Koha mailing list  http://koha-community.org
>> [hidden email]
>> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>>
>

--
Joelle Hannert
Library Technical Services Coordinator
Northwestern Michigan College
(231) 995-1684
Work days: M, W, Th, F
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: How to add authorized value to a report output

rogan
You can just select the value then, take out the "and ba.attribute = 'YES'"
and add ba.attribute to your select statement.

On Fri, Mar 6, 2020 at 12:01 PM Joelle Hannert <[hidden email]> wrote:

> Sorry, I should have been more clear. I'm not trying to select on the
> BANNERHOLD status (YES/NO/blank), I just want the contents of that field to
> be included in the report output for each patron reported.
>
> On Fri, Mar 6, 2020 at 10:29 AM <[hidden email]> wrote:
>
>> Hi Joelle,
>>
>> For the linking between borrower and borrower attributes you want to say
>> which borrower attribute you want via the code and you may want to specify
>> the value like this:
>>
>>  select b.cardnumber from borrowers b join borrower_attributes ba on
>> ba.borrowernumber = b.borrowernumber where ba.code = 'BANNERHOLD' and
>> ba.attribute = 'YES';
>>
>>
>>
>> On Fri, Mar 6, 2020 at 10:12 AM Joelle Hannert <[hidden email]> wrote:
>>
>>> I'm trying to get a report to include an output of a custom borrower
>>> attribute, but having trouble coming up with the correct way to ask for
>>> this in the SQL code. I feel like the answer is somewhere on this schema
>>> page:
>>> http://schema.koha-community.org/18_11/tables/borrower_attributes.html
>>> but
>>> nothing I'm trying is working. The authorized value for our local
>>> attribute
>>> is "BANNERHOLD."
>>> I tried the following:
>>>
>>>    - borrower_attributes.bannerhold
>>>    - borrower_attribute_types.bannerhold
>>>    - code.bannerhold
>>>
>>> I don't really understand how the relationships work, so it's just trial
>>> and error for me. Any advice would be much appreciated!
>>>
>>> Joelle
>>>
>>> --
>>> Joelle Hannert
>>> Library Technical Services Coordinator
>>> Northwestern Michigan College
>>> (231) 995-1684
>>> Work days: M, W, Th, F
>>> _______________________________________________
>>>
>>> Koha mailing list  http://koha-community.org
>>> [hidden email]
>>> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>>>
>>
>
> --
> Joelle Hannert
> Library Technical Services Coordinator
> Northwestern Michigan College
> (231) 995-1684
> Work days: M, W, Th, F
>
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha