Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Error getting month Name and Year

Author  Topic 

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2013-12-02 : 21:55:37

Hi Guys,

Here is my command in SSRS 2008 to get the Month Name and Year.
THe result of my command should be like this, if current date is > 26 then the month name should display "Jan-2014" Else "Dec-2013'.

Why I am getting an error with this command in SSRS? I have problem with the first condition. thanks.

=IIF(Day(Now()) > 26,MonthName(Month(Now())+1,3)&"-"&Year(now()),MonthName(Month(Now()),3)&"-"&Year(now()))

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-03 : 00:16:01
=Format(DateAdd(DateInterval.Day,DateDiff(DateInterval.Day,CDATE("01/01/1900"),Today()) + 5, CDATE("01/01/1900")),"MMM-yyyy")

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2013-12-03 : 19:31:12
Thank you very much Visakh.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-04 : 00:16:01
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -