You have some problems with your quotes. I'm not sure that I did the right corrections. Use the print to run the query that gets printed and debug from it.
use webproxy
DECLARE @tempsql varchar(2000)
select @tempsql =
'declare @xmonth varchar(2)
declare @xyear varchar(4)
declare @xdate varchar(10)
declare @rptmonth datetime
select @xmonth = MONTH(dateadd(month,-1,getdate()))
select @xyear = YEAR(dateadd(month,-1,getdate()))
select @xdate = @xmonth + ''/01/'' + @xyear
select @rptmonth = cast(@xdate as datetime)
set rowcount 0
select dbo.user_parser(clientusername) as "_user",
count(*) as "objects",
sum(cast(bytessent as float))as "bytes_sent",
sum(cast(bytesrecvd as float))as "bytes_received",
(sum(cast(bytessent as float)) + sum(cast(bytesrecvd as float)))as "total_bytes",
@rptmonth as "rpt_month"
----into ##top100temp
from webproxylog''' + cast(month(dateadd(m,-2,getdate())) as varchar(2)) + '''
--from webproxylog5
where dbo.user_parser(clientusername) <> '' ''
group by dbo.user_parser(clientusername)
order by total_bytes desc'
--print @tempsql
execute (@tempsql)