?
Solved

logic flow date format manipulation SSRS

Posted on 2013-01-04
3
Medium Priority
?
617 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 668 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 664 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 668 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

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

770 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