Solved

IIF Expression based on Parameter

Posted on 2008-10-29
5
594 Views
Last Modified: 2012-08-13
I need an expression that show a certain field based on a parameter input

--
=iif(Parameters!NetorGross.Value = "Net",Fields!EndbalanceNet.Value,
iif(Parameters!!NetorGross.Value = "Gross",Fields!EndBalanceGross.Value))
--
It keeps on blowing up
thx
0
Comment
Question by:fundsf
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
PedroCGD earned 250 total points
ID: 22843915
=iif(Parameters!NetorGross.Value = "Net",Fields!EndbalanceNet.Value,
iif(Parameters!!NetorGross.Value = "Gross",Fields!EndBalanceGross.Value,NEEDTHISVALUE))

You need to add a value in NEEDTHISVALUE Fixed it?
Regards
0
 
LVL 38

Assisted Solution

by:Jim P.
Jim P. earned 250 total points
ID: 22844056
Are you saying you want someone to type in "net" or "gross" in a pop-up box?

Try this:
=iif(Trim([Enter Net or Gross])  = "Net",Fields!EndbalanceNet.Value,
,Fields!EndBalanceGross.Value)

Open in new window

0
 

Author Closing Comment

by:fundsf
ID: 31511447
Thx,
I took pieces of both of your answers and it worked.

=iif(Parameters!NetorGross.Value = "Net",Fields!EndbalanceNet.Value,
Fields!EndBalanceGross.Value)
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22844565
Glad to be of assistance. May all your days get brighter and brighter.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

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.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

773 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