Solved

logic flow date format manipulation SSRS

Posted on 2013-01-04
3
611 Views
Last Modified: 2013-01-05
I have the following code

=IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value)


In this code I check to see if Fields!effectivedate.Value is the current month.
If it is the current month then it displays Fields!effectivedate.Value.
If it is not the current month then it displays the current date.


I would like assistance on the following.


****

1. In addition to doing this check I would like to check for another value
,   fields!Freeze.Value


Here is how it would look in VB.NET code


If fields!Freeze.Value = true

     Fields!effectdate.Value

else

     IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value)


end if


How would I write this in SSRS code?




Please ask for further clarification if i have failed to explain something properly.
0
Comment
Question by:michiganblkman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Assisted Solution

by:Saurabh Bhadauria
Saurabh Bhadauria earned 167 total points
ID: 38746260
Try it like this...

=iif(Fields!value.Value=1 ,Fields!value.Value,IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value))

Open in new window



Thanks,
Saurabh
0
 
LVL 25

Assisted Solution

by:TempDBA
TempDBA earned 166 total points
ID: 38746585
=iif(Fields!Freeze.Value = TRUE ,Fields!Freeze.Value, (IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value)))
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 167 total points
ID: 38746769
The following would work as well:

Switch(
	Fields!Freeze.Value = True, Fields!effectdate.Value,
	Month(Fields!effectivedate.Value) <> Month(Now()), Now(),
	True, Fields!effectdate.Value
)

Open in new window

More info on that Switch statement: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_2279-Adding-an-Else-to-your-Switch.html
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question