Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

logic flow date format manipulation SSRS

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

604 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