Create ext. Attribute in tab. BOOK or you can sort in the request as something? Tried to unite the BOOK and ISSUE nothing sensible came out ...
select Π½Π°Π·Π²Π°Π½ΠΈΠ΅, count(ΠΠΠΠΠ.ΠΊΠΎΠ΄_ΠΊΠ½ΠΈΠ³ΠΈ) as ΠΊΠΎΠ»_Π²ΠΎ from dbo.ΠΡΠ΄Π°ΡΠ° INNER JOIN dbo.ΠΠ½ΠΈΠ³Π° ON dbo.ΠΡΠ΄Π°ΡΠ°.ΠΊΠΎΠ΄_ΠΊΠ½ΠΈΠ³ΠΈ = dbo.ΠΠ½ΠΈΠ³Π°.ΠΊΠΎΠ΄_ΠΊΠ½ΠΈΠ³ΠΈ where Π΄Π°ΡΠ°_Π²ΠΎΠ·Π²ΡΠ°ΡΠ° < getdate() and ΡΠ°ΠΊΡ_Π²ΠΎΠ·Π²ΡΠ°Ρ is not null GROUP BY Π½Π°Π·Π²Π°Π½ΠΈΠ΅ 