Solved

logic flow date format manipulation SSRS

Posted on 2013-01-04
3
601 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
3 Comments
 
LVL 12

Assisted Solution

by:Saurabh Bhadauria
Saurabh Bhadauria earned 167 total points
Comment Utility
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
Comment Utility
=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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now