Solved

logic flow date format manipulation SSRS

Posted on 2013-01-04
3
607 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

856 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