Blog Stats
  • Posts - 14
  • Articles - 0
  • Comments - 14
  • Trackbacks - 0

 

Wednesday, August 19, 2009

A couple of Good links for SQL Server Pivots

http://www.simple-talk.com/community/blogs/andras/archive/2007/09/14/37265.aspx

 

http://www.tsqltutorials.com/pivot.php

 

PS: For more complex  Queries, inner SQL's Group By are important and you might also need to use Sum in inner SQL

Hide table column Dynamically in SQL Server Reporting Services (SSRS)

Quite Straight forward:

  1. Select the Column , Right Click -> Propoerties OR hit F4
  2. Visibility -> Hidden -> Expression i.e. Click on Hidden under Visibility and select Expression from Drop Down
  3. Write the expression e,g.

=IIF(Parameters!MonthlyOrYearly.Value.Equals("Monthly"),false,true)

Format Date in SQL Server Reporting Services

compared to FormatDateTime Good old 'Format' function makes the job a lot easier :

 

  1.  Format(Fields!ResultDate.Value,"M/d/yyyy")
  2. Format(Fields!ResultDate.Value,"yyyy")

=IIF(Parameters!MonthlyOrYearly.Value.Equals(Monthly"),Format(Fields!ResultDate.Value,"M/d/yyyy"),Format(Fields!ResultDate.Value,"yyyy"))

 

 

 

 

 

Copyright © faizanahmad