It's just like Julie said:
Declare @BeginDate varchar(8)
Declare @EndDate varchar(8)
Select @BeginDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -2, Getdate())),0),112)
Select @EndDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -1, Getdate())),0),112)
You've gotta declare and set those...