sql server – procedure not returning desired result

i am trying to generate a report from below procedure

—proc
create procedure (dbo).(hstatement)
(@fromdate date,
@todate date,
@prd varchar(8)
)
as
begin
create table #tempdata
(
LBrCode int,
prdCode varchar(8),
bal_date datetime,
bal_amt numeric(18,2)
)
while @fromdate<@todate
begin
insert into #tempdata
select LBrCode,
substring(PrdAcctId,1,8) prdcd,
convert(varchar(12),@fromdate,106) tdt,
Balance4
from
(
select LBrCode,PrdAcctId,CblDate dt,Balance4,
rank() over (partition by LBrCode,PrdAcctId order by CblDate desc ) rnk from cl_balance
where rtrim(substring(PrdAcctId,1,8)) in (@prd)
and floor(cast(substring(PrdAcctId,17,8) as int))=0
and CblDate<=@fromdate
) x where rnk= 1 and LBrCode=1;
set @fromdate=dateadd(day,1,@fromdate)
end;

procedure is compiled successfully.
however i am expecting a result as each date between fromdate and todate but getting only one record(first)

please help