renee35
MIS
- Jan 30, 2007
- 199
I am getting the following error when trying to write the following formulas:
SET @StartDate = cast ((@qtr*3)-2) as varchar(1))+ '/1/' + cast(@year as varchar(4)) as datetime)
SET @EndDate = cast((@qtr*3) as varchar(1)) + '/1/' + cast(@year as varchar(4)) as datetime)
Error: Incorrect syntax near the keyword 'as'.
Incorrect syntax near 'cast', expected 'AS'
Should I be using convert instead?
Any help would be greatly appreciated.
Thanks a bunch!!
-T
SET @StartDate = cast ((@qtr*3)-2) as varchar(1))+ '/1/' + cast(@year as varchar(4)) as datetime)
SET @EndDate = cast((@qtr*3) as varchar(1)) + '/1/' + cast(@year as varchar(4)) as datetime)
Error: Incorrect syntax near the keyword 'as'.
Incorrect syntax near 'cast', expected 'AS'
Should I be using convert instead?
Any help would be greatly appreciated.
Thanks a bunch!!
-T