SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Error getting month Name and Year
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Villanuev
Constraint Violating Yak Guru

441 Posts

Posted - 12/02/2013 :  21:55:37  Show Profile  Reply with Quote

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

India
52323 Posts

Posted - 12/03/2013 :  00:16:01  Show Profile  Reply with Quote
=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

441 Posts

Posted - 12/03/2013 :  19:31:12  Show Profile  Reply with Quote
Thank you very much Visakh.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/04/2013 :  00:16:01  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000