SSRS - Repeat Page Headers on Every Page

Here we will learn how to design an SSRS report that repeats the column headers of a Table on every page.

The following report contains four Tablix regions. Each one is a table with a single row group representing a calendar year. The Dataset contains a SELECT statements that aggregates sales amount by year and country:

SQL Server - Working with Dates Part 1

Ian & I have received a lot of queries from past delegates about handling various date challenges when extracting data from SQL Server and Oracle databases, so we are adding them to our blog for your reference. There will be a series of posts and this is Part 1.

The following examples are for SQL Server, and are based on the AdventureWorks2014 sample database.

The following queries uses the DATENAME and DATEADD functions.

DATENAME Function

DATENAME can be used to extract a specified part of a date/time value. It takes two arguments:

MDX - Ranking And Ordering By a Measure Value

The following example is based on an Adventure Works cube and shows you how to create a measure that ranks countries according to sales revenue.

It implements the following MDX functions:

  • Rank
  • CurrentMember
  • Children
  • Order

Rank by Largest to Smallest

The MDX WITH MEMBER statement creates a temporary measure for the rank value based on total internet slaes in the calendar year 2006, and the associated SELECT part uses the rank to order the countries.

Common Table Expressions (CTEs) To The Rescue!

I was recently asked by a delegate how they could calculate lost work hours due to sick days on a per month basis. This might sound fairly straight forward, but their database only stored the start date for the sickness period and the number of days for the sickness period. So, that means that if an employee was off sick for a period of 5 days starting October 28th, 3 of the days should be counted into October and 2 of the days should be counted in November. Not so simple after all!

SQL Server EXECUTE Statement with RESULT SET

SQL Server 2012 introduced a RESULT SET clause to the EXECUTE statement.

It can be used to specify alternate data types and column names for result sets returned by an EXECUTED statement or Stored Procedure.

The examples in this article are based on the AdvetureWorks2014 database.

The following example shows its use with an ad-hoc query example.

Pages