我正在尝试创建一个生成工具租金的报告,因为它需要是交互式的,我希望用户能够输入工具的部分名称或全名以显示该工具的所有租金。
TTITLE CENTER ==================== SKIP 1-
CENTER 'U T O O L' skip 1-
CENTER ==================== SKIP 1 -
LEFT 'Rental Report ' SKIP 1 -
LEFT ============ SKIP 2-
RIGHT 'Page:' -
FORMAT 999 SQL.PNO SKIP 2
set pagesize 50
column MEMBERNAME HEADING 'Member Name' format a20
column TOTAL HEADING 'Total Cost' format L9,999.99
compute sum label 'Total Cost: ' of TOTAL on MEMBERNAME
Break on Rental_ID on Member_ID on MEMBERNAME on Member_ID on Tel SKIP 1
select Member.Member_ID, SUBSTR(Member.FName,0,10) || SUBSTR(' ',0,10) ||
SUBSTR(Member.SName,0,15) as MEMBERNAME, Member.Tel,
Rental.Rental_ID,
Tool.Name,
Rental.DateOut,
Rental.DateIn,
Rental_Line.Qty,
Rental_Line.Price,
Rental_Line.Qty*Rental_Line.Price as TOTAL
from Rental_Line
INNER JOIN Rental
on Rental.Rental_ID = Rental_Line.Rental_ID
INNER JOIN Member
on Rental.Member_ID = Member.Member_ID
INNER JOIN Tool_Instance
on Rental_Line.Tool_Instance_ID = Tool_Instance.Tool_Instance_ID
INNER JOIN Tool
on Tool_Instance.Tool_ID = Tool.Tool_ID
where Tool.Name = '%&_%';