Because I started sqlserver 3 months ago.
>>Thanks my professor,
>>
>>Now it has problem on this line
>>
>>select code as acc_code, 0 as op_qty, 0 as pr_qty, sum(qty) as sl_qty, 0 as sr_qty from cashsalp where code like '32%' and LEN(acc_code)=7
>> GROUP BY acc_code
>>
>>
>>Msg 8120, Level 16, State 1, Line 10
>>Column 'cashsalp.code' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
>>
>
>Nick corrected the typo I overlooked, but you should be able to figure out this yourself. Why do you want others to write code for you and you don't even try to correct such simple things yourself?