Possible Duplicate:
Months between two dates
I need to bring the result ,what are the months falls between two dates.
Eg. Suppose date is
Declare @FrDate datetime,@ToDate datetime
Set @FrDate ='2010-05-31 17:38:58.577'
Set @ToDate ='2010-09-01 17:38:58.577'
need Output
Result
MAY
JUN
JUL
AUG
SEP
Try this one:
Result:
To get short month name in result you can use the following line instead:
To get month name in UPPER case you can use
UPPERfunction for that: