Selecting Multiple Rows as a Single Column in SQL

Recently, I was writing a report that selected some data out of a normalized SQL Server database. For one of the queries, I needed a “flattened” form of the rows in one of the tables. In essence, what I needed to do was turn several rows of data into a single column.

[more]


SQL Bitwise Mask Example


SQL Script to Find Work Week Start and End

If you are looking for the Monday that starts a work week and/or the Friday that ends the work week, this is how you do it in SQL:


SQL Script to Find Last Day of the Month

This Microsoft SQL script figures out what the last day of the month is (28, 30, or 31) so that you don't have to recite the "30 days has September, April, May, and November..." poem or do the "knuckle trick."


Microsoft SQL Reporting Services URL Query Parameters and Commands

There are several parameters that can be passed in to the SRS Report viewer through query string parameters. Some of them are listed below:

Change the way it is rendered:
rs:Command=Render& (4 types of re:Commands)

Pass in parameter values:
PARAMNAME1:isnull=true&PARAMNAME2=PARAMVALUE2&

Control the type of output:
rs:Format=PDF

Control what toolbar(s) show in the viewer:
rc:Toolbar=False
rc:Parameters=False