Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display value in correct column 1

Status
Not open for further replies.

renee35

MIS
Jan 30, 2007
199
I have created a report using SQL Server 2005 and there are 2 columns that display the same data. I need to write a statement that will determine which column the value should display in. This is based on the status. Example, if the status is open then is should display under the "Pending" column else under the "Collected". Keep in mind the Pending and Collected comes from the same field and have the same data in them, but it depends on the status as to which one is used.

Pending Collected Status
100k 100k Open

In this example, in the report I am trying to create the value should appear under the pending column only.

Thanks for any advice!!

Thanks a bunch!!

-T
 
You could put an expression in the Pending column:

=IIF(Fields!Status.Value = "Open",Fields!Amount.Value,"")

Then in the Collected column, you will need another expression that does the same but for whatever the Status should be.

Hope this makes sense
Adam

Adam Blackwell
Information Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top