create proc P_GetInfo
(
@Month int,
@year int
)
as
declare
@F_M varchar(30)
case 
 when @Month=1 then  @year=@year-1 , @F_M=F_12M  
 when @Month=2 then @F_M=F_1M 
 when @Month=3 then @F_M=F_2M
 when @Month=4 then @F_M=F_3M
 when @Month=5 then @F_M=F_4M
 when @Month=6 then @F_M=F_5M
 when @Month=7 then @F_M=F_6M
 when @Month=8 then @F_M=F_7M
 when @Month=9 then @F_M=F_8M
 when @Month=10 then @F_M=F_9M
 when @Month=11 then @F_M=F_10M
 when @Month=12 then @F_M=F_11M endselect  OutCount.DT_DataTime as date
,InCount.S_GoodsText as GName
,InCount.HasCount as CountIn
,OutCount.HasCount as CountOut
,(((@F_M)+InCount.HasCount)-OutCount.HasCount) as  leave 
,@F_M as first
--,case when  datepart(day,OutCount.DT_DataTime)=23 then 
-- --else V_GetInfo.leave 
-- end as first
from T_GoodsCount怎么老是提示要先声明 @F_M  哪错了