|
rama108
Yak Posting Veteran
72 Posts |
Posted - 05/17/2012 : 16:11:39
|
Hello All, I have the following query:
I am storing the start month in a variable called @StartMonth. Then I want to cast 'month1' as the month in the @StartMonth
select ISNULL(AVG(month1),0) AS DATENAME(month,@StartMonth)
The date store is 'Jul 1 2008 12:00AM', so you can also try the following, but it complains: "incorrect syntac near 'month'. What is wrong with the following?
select ISNULL(AVG(month1),0) AS DATENAME(month,'Jul 1 2008 12:00AM')
Thank you, Rama |
|