procedure not returning desired result
In this section of your procedure:
where rtrim(substring(PrdAcctId,1,8)) in (@prd)
              and floor(cast(substring(PrdAcctId,17,8) as int))=0
              and CblDate&lt;=@fromdate

you are using the @fromdate as the filter and looking for the values earlier.  Then you increase the @fromdate value.  But the earliest date before Wednesday of the current week is still the same when I get the earliest date before Thursday of the current week - so wouldn't you end up with the same record?
I also assume there is more to the procedure as you only insert into the temp table and never query it?   What is the remainder of the procedure?  Please post the entire code.   Do you get multiple records with the same value as the output?