Friday, 6 September 2013

REPORTING SERVER Expressions

--color for alternate rows
=IIF(RowNumber(NOTHING) MOD 2=0,"Plum","Khaki")

--Row Number
 =RowNumber(nothing)

--text color
=IIF(Fields!DATETIME_PRECISION.Value>1,"Red","Black")

--Count of Rows
=COUNT(Fields!TABLE_SCHEMA.Value, "DataSet1")

--SPLIT & JOIN 
=SPLIT(JOIN(Parameters!DEPTNO.Value,","),",")

--sum of salary
=Sum(Fields!SAL.Value, "DataSet1")

--sum of each dept sal
=sum(Fields!SAL.Value)

Different types of joins in SQLSERVER

--------------------------Different types of joins-----------------------

1.FULL OUTER JOIN

SELECT * FROM [table name1] T1 FULL OUTER JOIN [table name2] T2 ON 
           T1.[column name]=T2.[column name]


DECLARE @id INT
SELECT * FROM [table name] WHERE [column name]=@id  
                 OR [column name] IS NULL

EMP, DEPT Sample script

/****** Object:  Table [dbo].[DEPT]    Script Date: 19-05-2016 06:58:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET A...