How to get statistic for borrowed item by borrower with department
Hi all master I need help with this matter where I need koha GUI sql script for:- A statistic for the borrowed item by a borrower with the department (if can do in the date range) tq for advance -- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
Hi ikbar, where do you store the department? Is it the library/branch or some other field in the borrower? Do you just need the number of checkouts, borrower information and department? Or a list with one line for each item? Katrin On 05.04.19 11:44, ikbar wrote:
Hi all master
I need help with this matter where I need koha GUI sql script for:-
A statistic for the borrowed item by a borrower with the department (if can do in the date range)
tq for advance
-- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
Department stored at Sort 1 Let me tell the situation : Do you just need the number of checkouts, borrower information and department? ----> YES Or a list with one line for each item? ----> Also YES add a timestamp My english is not good... anyway tq an advance for helping me katrin -- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
Hi ikbar, a list of patrons with the number of current checkouts (not returned yet) ordered by department could look something like that: SELECT sort1 as department, cardnumber, surname, firstname, (select count(*) from issues i where i.borrowernumber = b.borrowernumber) as Checkouts FROM borrowers b GROUP BY b.borrowernumber ORDER BY sort1, surname, firstname That's only one option. If you also want to count checkouts already returned, you could use the statistics table: SELECT sort1 as department, cardnumber, surname, firstname, COUNT(*) as checkouts FROM borrowers b JOIN statistics s ON (b.borrowernumber = s.borrowernumber) WHERE DATE(datetime) between <<From|date>> and <<Until|date>> GROUP BY b.borrowernumber ORDER BY sort1, surname, firstname Note: There is almost always more than one way to do it :) Keep in mind if you: - Want current checkouts or all checkouts in a date range - Want to include only information about current patrons or deleted patrons as well You can find more examples for reports in the Reports Library on the wiki: https://wiki.koha-community.org/wiki/SQL_Reports_Library To get a list of checkouts with information about the item, this one could be a good starting point: https://wiki.koha-community.org/wiki/SQL_Reports_Circulation#All_Checked_Out... Hope that helps, Katrin On 08.04.19 07:24, ikbar wrote:
Department stored at Sort 1
Let me tell the situation :
Do you just need the number of checkouts, borrower information and department? ----> YES
Or a list with one line for each item? ----> Also YES
add a timestamp
My english is not good... anyway tq an advance for helping me katrin
-- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
hi katrin thanks for helping me but i do run the script but an error occurs >The following error was encountered: The database returned the following error: called with 2 bind variables when 0 are needed Please check the log for further details. Return to previous page < as you told me : - Keep in mind if you: - Want current checkouts or all checkouts in a date range ---> all checkouts - Want to include only information about current patrons or deleted patrons as well ---> current/active borrowers first name and cardnumber thank you for advance katrin -- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
Hi ikbar, which of the statements did you try to run? Did you run them in Koha or in an SQL editor? Please make sure there is no whitespace before the SELECT at the very beginning. Katrin On 17.04.19 12:17, ikbar wrote:
hi katrin
thanks for helping me but i do run the script but an error occurs >The following error was encountered: The database returned the following error: called with 2 bind variables when 0 are needed Please check the log for further details. Return to previous page <
as you told me : - Keep in mind if you:
- Want current checkouts or all checkouts in a date range ---> all checkouts - Want to include only information about current patrons or deleted patrons as well ---> current/active borrowers first name and cardnumber
thank you for advance katrin
-- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
hi katrin yes, im run them in koha -- Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
participants (2)
-
ikbar -
Katrin Fischer