all groups > sql server reporting services > january 2005 >
You're in the

sql server reporting services

group:

If...Then Statement in Table


If...Then Statement in Table sbaker
1/4/2005 12:55:07 PM
sql server reporting services:
I am new to using Reporting services and was wondering if it is possible to
use if...then statements within a table. Ultimatley, I would like to build a
table that displays prior day sales, current month, current quarter, and
current year sales. Any suggestions?

Thanks,

Re: If...Then Statement in Table Jeff A. Stucker
1/4/2005 7:53:01 PM
Check out IIF() and Switch()

--
Cheers,

'(' Jeff A. Stucker
\

Business Intelligence
www.criadvantage.com
--------------------------------------
[quoted text, click to view]

RE: If...Then Statement in Table Logicalman
1/5/2005 4:25:02 AM
If..Then statements are represented in TSQL as Case When statements.

e.g. to calculate the difference in days between two columns, but only if
the second column has a date, then:

CASE WHEN NOT(col2 IS NULL) THEN Datediff(d,col1,col2) ELSE NULL END AS
DaysTaken

Hope this helps

Tony

[quoted text, click to view]
Re: If...Then Statement in Table Jeff A. Stucker
1/6/2005 9:25:58 PM
I see we interpreted his question two different ways. Scott, is this a SQL
database table or report table we're talking about?

--
Cheers,

'(' Jeff A. Stucker
\

Business Intelligence
www.criadvantage.com
--------------------------------------
[quoted text, click to view]

Re: If...Then Statement in Table Logicalman
1/7/2005 2:31:03 AM
Jeff,
Yep, I see what you mean.

Scott,
To clarify my answer, I would put the logic in the dataset, or on the SQL
Server side, rather than in the table. If the latter is not possible, then it
can be included in the dataset schema on the RS side.
This alleviates any problems with the table object in the report, and
exsposes the code early on for modification.

Thanks for clarifying the position Jeff.

Tony

[quoted text, click to view]
AddThis Social Bookmark Button