Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 ColorCode

Author  Topic 

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 2009-09-22 : 14:08:19
I'm trying understand the following part of a stored procedure and the term ColorCode in the procedure. I don't see ColorCode in the rest of the stored procedure, so I was wondering if ColorCode is a T-SQL command.

I'm using the stored procedure as part of a SQL report and I'm trying to understand what is populating ColorCode.

Any help would be greatly appreciated.

-----------------------------------------------------------

EXEC ('SELECT StartDateTime,
SystemName,
CASE WHEN CategoryName IS NULL OR CategoryName = ''''
THEN ''Not Defined''
ELSE CategoryName
END AS CategoryName,
CASE WHEN StartDateTime >= '''+@StartDateTime+''' AND EndDateTime <= '''+ @EndDateTime +'''
THEN DATEDIFF(ss,StartDateTime,EndDateTime)
WHEN StartDateTime >= '''+@StartDateTime+''' AND EndDateTime > '''+ @EndDateTime +'''
THEN DATEDIFF(ss,StartDateTime,'''+ @EndDateTime +''')
WHEN StartDateTime < '''+@StartDateTime+''' AND EndDateTime <= '''+ @EndDateTime +'''
THEN DATEDIFF(ss,'''+ @StartDateTime +''',EndDateTime)
WHEN StartDateTime < '''+@StartDateTime+''' AND EndDateTime > '''+ @EndDateTime +'''
THEN DATEDIFF(ss,'''+ @StartDateTime +''','''+ @EndDateTime +''')
END AS Duration ,
CASE WHEN ColorCode IS NULL
THEN ''Black''
ELSE ColorCode
END AS ColorCode

FROM [table]
WHERE ((StartDateTime >= '''+@StartDateTime+''' AND StartDateTime < '''+ @EndDateTime +''')
OR (EndDateTime > '''+@StartDateTime+''' AND EndDateTime <= '''+ @EndDateTime +''')
OR (StartDateTime < '''+@StartDateTime+''' AND EndDateTime > '''+ @EndDateTime +'''))
'+ @WhereClause +'
ORDER BY SystemName,StartDateTime')

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-09-22 : 14:23:30
Is rpt_vwEvents a table in reporting services? I just checked my server and do not have that table.

John

"The smoke monster is just the Others doing barbecue"
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-09-22 : 15:16:51
DUPE Post. Resolved here:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=133240


Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -