<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1661221027110337510</id><updated>2024-12-19T03:18:24.596+00:00</updated><category term="SSRS"/><category term="SQL"/><category term="CR"/><category term="SQL Server Reporting Services"/><category term="Parameter"/><category term="Crystal Reports"/><category term="Auxiliary"/><category term="CTE"/><category term="Dates"/><category term="DateAdd"/><category term="Iif"/><category term="GetDate"/><category term="Green bar"/><category term="Mod"/><category term="page size"/><category term="Common Table Expression"/><category term="CurrentDate"/><category term="Format"/><category term="Layout"/><category term="Null"/><category term="Replace"/><category term="SQL Server 2005"/><category term="SQL Server 2008 R2"/><category term="Select Case"/><category term="URL"/><category term="date"/><category term="CREATE TABLE"/><category term="DROP TABLE"/><category term="Date and Time"/><category term="DateDiff"/><category term="Datetime"/><category term="Except"/><category term="Function"/><category term="IIS"/><category term="InteractiveHeight"/><category term="InteractiveSize"/><category term="Javascript"/><category term="Month"/><category term="Numbers Table"/><category term="Over"/><category term="Partition By"/><category term="Perfomance"/><category term="Row_Number"/><category term="Select All"/><category term="Subreport"/><category term="Year"/><category term="multivalued"/><category term="Access Rights"/><category term="CHR(10)"/><category term="Carriage Return"/><category term="Cast"/><category term="Condensing"/><category term="Count"/><category term="CountDistinct"/><category term="DBCC commands"/><category term="Datepart"/><category term="Disable"/><category term="Group"/><category term="Group Header"/><category term="If"/><category term="Index"/><category term="Left"/><category term="Len"/><category term="Limit"/><category term="List of dates"/><category term="Missing Dates"/><category term="Months Table"/><category term="Object_ID"/><category term="Processing"/><category term="RDL"/><category term="Report Execution"/><category term="SP3"/><category term="SQL Commands"/><category term="SQL Server Profiler"/><category term="Service Pack"/><category term="Stored Procedures"/><category term="Switch"/><category term="Templates"/><category term="ToText"/><category term="URL command sections"/><category term="XML"/><category term="nth record"/><category term="uniqueidentifier"/><category term=".NET Framework"/><category term="A3"/><category term="A4"/><category term="ASPNET"/><category term="AVG"/><category term="Add Command"/><category term="After Update"/><category term="Alternate rows"/><category term="Array"/><category term="Bulk Insert"/><category term="Button Style"/><category term="CHAR(10)"/><category term="CHAR(13)"/><category term="CHAR(9)"/><category term="CHECKSUM"/><category term="CHECKSUM(NEWID())"/><category term="CSS"/><category term="Calendar table"/><category term="Char"/><category term="Character Codes"/><category term="Checkbox"/><category term="Chr"/><category term="Colour Graduation"/><category term="Column alias"/><category term="Columns"/><category term="Conditional formatting"/><category term="Connectivity"/><category term="Continued"/><category term="Convert time to string"/><category term="Crystal Reports Processing Engine"/><category term="CurrentDateTime"/><category term="DBCC SQLPERF"/><category term="DY"/><category term="Database name"/><category term="Dataset"/><category term="Datasetname"/><category term="Datasetname.commandtext. display a dataset query"/><category term="DateName"/><category term="Derived table"/><category term="Detailed or Overview report"/><category term="Diana Lite"/><category term="Do"/><category term="Else"/><category term="Embedded Images"/><category term="FOR XML PATH"/><category term="Group Expert"/><category term="GroupNumber"/><category term="HtmlViewer.css"/><category term="IIS7"/><category term="INFORMATION_SCHEMA.COLUMNS"/><category term="ISO 8601"/><category term="InRepeatedGroupHeader"/><category term="Index usage"/><category term="Insert"/><category term="Install"/><category term="Installation"/><category term="Instr"/><category term="Internet Information Services"/><category term="IsNothing"/><category term="Join"/><category term="Landscape"/><category term="Length"/><category term="Line Feed"/><category term="LinkScanner"/><category term="List of Value Limit"/><category term="Location"/><category term="MAXRECURSION"/><category term="Management"/><category term="Matrix"/><category term="Missing Indexes"/><category term="Modular"/><category term="MonthName"/><category term="Msg 409"/><category term="NEWID()"/><category term="Nob Hill Software"/><category term="Numbers"/><category term="Outer Join"/><category term="Page x of y"/><category term="Pagination"/><category term="Portrait"/><category term="Preserve"/><category term="Printed by and time"/><category term="Processing model"/><category term="Product Key"/><category term="Query Tuning"/><category term="RAND()"/><category term="Redim"/><category term="Repeat Group Header"/><category term="Reporting Services Configuration"/><category term="Reverse"/><category term="RunningValue"/><category term="SAP"/><category term="SQL Server 2005 System Views"/><category term="SQL Server Version"/><category term="SQL:BatchCompleted"/><category term="Self Join"/><category term="Set Operation"/><category term="Sql Server Management Studio"/><category term="String"/><category term="String manipulation"/><category term="Stuff"/><category term="System Views"/><category term="System Waits"/><category term="Tab"/><category term="TargetServerURL"/><category term="Test Data"/><category term="Then"/><category term="Tick"/><category term="Time"/><category term="Time to String"/><category term="Trigger"/><category term="Unicode"/><category term="Union"/><category term="VBCRLF"/><category term="Version"/><category term="View"/><category term="Views"/><category term="WK"/><category term="Weekday"/><category term="While"/><category term="Windows 7"/><category term="Wingding"/><category term="aggregate"/><category term="alter_table"/><category term="antivirus"/><category term="comparison"/><category term="concatenates"/><category term="convert"/><category term="current_timestamp"/><category term="data types"/><category term="dateserial"/><category term="decimal"/><category term="display all"/><category term="drop_table"/><category term="dropdown"/><category term="duplicate"/><category term="end of year"/><category term="financial year"/><category term="fiscal year"/><category term="hexadecimal"/><category term="isnull"/><category term="lag"/><category term="linebreak"/><category term="metadata"/><category term="nth largest"/><category term="parameter label field"/><category term="query hint"/><category term="random"/><category term="recordnumber"/><category term="recursion"/><category term="remainder"/><category term="remove"/><category term="rownumber"/><category term="smalldatetime"/><category term="sp_executesql"/><category term="start of year"/><category term="sys.dm_db_index_usage_stats"/><category term="sys.dm_db_missing_index_details"/><category term="sys.dm_os_wait_stats"/><category term="sys.indexes"/><category term="uppercase"/><category term="width"/><title type='text'>SQL Server, SSRS and Crystal Reports</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default?start-index=26&amp;max-results=25'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>119</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-4440699243178861741</id><published>2018-06-06T14:51:00.002+01:00</published><updated>2018-06-06T14:51:49.354+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="duplicate"/><category scheme="http://www.blogger.com/atom/ns#" term="lag"/><category scheme="http://www.blogger.com/atom/ns#" term="Partition By"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQL - duplicate values</title><content type='html'>List of employees for example. Quick way to find duplicate values using LAG windowing function&lt;br /&gt;
&lt;br /&gt;
;with c as (&lt;br /&gt;SELECT [FirstName]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[LastName],&lt;br /&gt;&amp;nbsp;&amp;nbsp; [FirstName]&amp;nbsp; + &#39; &#39; +&amp;nbsp;&amp;nbsp; [LastName] x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[StaffNumber]&lt;br /&gt;&amp;nbsp;FROM Employee&lt;br /&gt;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp; cc as(&lt;br /&gt;&amp;nbsp; SELECT FirstName, LastName, StaffNumber, x , lag (x) over (partition by LastName order by x) dup&lt;br /&gt;&amp;nbsp; from c)&lt;br /&gt;&amp;nbsp; select FirstName, LastName, StaffNumber, x ,&amp;nbsp; dup From cc&lt;br /&gt;&amp;nbsp; where x=dup&lt;br /&gt;&amp;nbsp; order by LastName</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/4440699243178861741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/4440699243178861741?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4440699243178861741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4440699243178861741'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2018/06/sql-duplicate-values.html' title='SQL - duplicate values'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-4103023235348139291</id><published>2018-05-24T15:32:00.000+01:00</published><updated>2018-05-24T15:32:33.612+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Count"/><category scheme="http://www.blogger.com/atom/ns#" term="CountDistinct"/><category scheme="http://www.blogger.com/atom/ns#" term="Over"/><category scheme="http://www.blogger.com/atom/ns#" term="Partition By"/><title type='text'>Count Distinct Over Partition</title><content type='html'>To get a count of distinct values over a windowing partition:&lt;br /&gt;
&lt;br /&gt;
DENSE_RANK() OVER (PARTITION BY e.Dept_Desc order by e.Staff_No) &lt;br /&gt;+ DENSE_RANK() OVER (PARTITION BY e.Dept_Desc order by e.Staff_No desc) &lt;br /&gt;- 1</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/4103023235348139291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/4103023235348139291?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4103023235348139291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4103023235348139291'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2018/05/count-distinct-over-partition.html' title='Count Distinct Over Partition'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-2476085293469980257</id><published>2017-09-01T16:34:00.005+01:00</published><updated>2017-09-01T16:34:58.832+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="URL"/><title type='text'>Using javascript to encode a URL with an ampersand</title><content type='html'>javascript escape function:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;=&quot;javascript:void(window.open(&#39;http://xxx/reportserver?/Folder A/Report X&quot; &amp;amp; &quot;&amp;amp;rs:Command=Render&quot; &amp;amp; &quot;&amp;amp;rc:Parameters=true&quot; &amp;amp; &quot;&amp;amp;param1=&quot; &lt;br /&gt;&amp;amp; replace(&lt;br /&gt;Fields!description.Value, &quot;&amp;amp;&quot;, &quot;&#39;+escape(&#39;&amp;amp;&#39;)+&#39;&quot;&lt;br /&gt;) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&amp;amp; &quot;&#39;));&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/2476085293469980257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/2476085293469980257?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/2476085293469980257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/2476085293469980257'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2017/09/using-javascript-to-encode-url-with.html' title='Using javascript to encode a URL with an ampersand'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-1855589224492746977</id><published>2017-05-23T14:00:00.002+01:00</published><updated>2017-05-23T14:00:57.215+01:00</updated><title type='text'>SSRS chart display % on labels issue</title><content type='html'>SSRS chart display % on labels&amp;nbsp;issue&lt;br /&gt;
&lt;br /&gt;
To show percentage symbol after a literal value:&lt;br /&gt;
&lt;br /&gt;
Chart series label - Properties&lt;br /&gt;
Format = 0\% or 0.00\% (depending on no. of dec. places reqd)</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/1855589224492746977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/1855589224492746977?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/1855589224492746977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/1855589224492746977'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2017/05/ssrs-chart-display-on-labels-issue.html' title='SSRS chart display % on labels issue'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-4755372123084106940</id><published>2017-02-13T12:41:00.000+00:00</published><updated>2018-01-09T14:48:40.815+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><category scheme="http://www.blogger.com/atom/ns#" term="URL"/><title type='text'>ssrs url javascript </title><content type='html'>&lt;span class=&quot;pun&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;-ms-word-wrap: normal; background-color: #eff0f1; border: 0px currentColor; color: #393318; display: block; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;dejavu sans mono&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , monospace , sans-serif; font-size: 13px; font-style: normal; font-weight: normal; height: 228px; letter-spacing: normal; margin: 0px 0px 1em; max-height: 600px; overflow: auto; padding: 5px; text-align: left; text-indent: 0px; text-transform: none; width: 653px; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&lt;code style=&quot;background-color: #eff0f1; border: 0px currentColor; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;Javascript:&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; IIF&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Fields&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;)=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;RESTRICTED-&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
        &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;alert(&#39;Restricted!&#39;); &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; IIF&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Fields&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Name_Alert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;alert(&#39;Alternate Alert!&#39;); &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;void(window.open(&#39;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Globals&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;ReportServerUrl&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;/Pages/ReportViewer.aspx?%2fJPD%2fPO_Dashboard%2fJuvenile_Profile&amp;amp;rs:Command=Render&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;&amp;amp;rc:Parameters=true&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot;&amp;amp;Emp_Number=&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Parameters&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Param1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px currentcolor; color: #2b91af; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;“&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px currentcolor; color: #303336; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&quot; &amp;amp; Fields!ID.Value &amp;amp; &quot;&#39;));&quot;&lt;/span&gt;&lt;/code&gt;

&lt;code style=&quot;background-color: #eff0f1; border: 0px currentColor; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/code&gt;

&lt;code style=&quot;background-color: #eff0f1; border: 0px currentColor; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px currentcolor; color: #7d2727; font-size: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pun&quot;&gt;
&lt;/span&gt;Courtesy of Christoper Brown at:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/18003013/open-ssrs-url-in-new-window&quot;&gt;http://stackoverflow.com/questions/18003013/open-ssrs-url-in-new-window&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;=iif(&lt;br /&gt;
&lt;br /&gt;
COUNT(Fields!ABC.Value)&amp;gt;0,&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;javascript:void(window.open(&#39;http://XXX/reportserver?/my Reports/this report&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&amp;amp;rs:Command=Render&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;    &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&amp;amp;rc:Parameters=true&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;    &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&amp;amp;p1=&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &amp;amp; Parameters!p1.Value &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&amp;amp;f1=&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &amp;amp; Fields!f1.Value&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;    &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&amp;amp;f2&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &amp;amp; Fields!f2.Value &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&quot;&#39;));&quot;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;NOTHING&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;URL encoding&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; Replace(Fields!myfield.Value,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&amp;amp;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;&#39; + escape(&#39;&amp;amp;&#39;) + &#39;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6462b0f6-d784-4c7a-afe0-2813bec5770a/url-action-with-javascript-and-ssas-parameter?forum=sqlreportingservices&quot;&gt;https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6462b0f6-d784-4c7a-afe0-2813bec5770a/url-action-with-javascript-and-ssas-parameter?forum=sqlreportingservices&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/4755372123084106940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/4755372123084106940?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4755372123084106940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4755372123084106940'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2017/02/ssrs-url-javascript.html' title='ssrs url javascript '/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-6180323364993263263</id><published>2016-10-11T09:48:00.002+01:00</published><updated>2016-10-11T09:48:29.115+01:00</updated><title type='text'>SSRS custom sort</title><content type='html'>&lt;span style=&quot;font-size: xx-small;&quot;&gt;Public Function CustomSortOrder(ByVal RAG As String) as Integer&lt;br /&gt;

&lt;br /&gt;
     Select Case RAG&lt;br /&gt;

&lt;br /&gt;
        Case = &quot;Up to 6 month&quot;&lt;br /&gt;

&lt;br /&gt;
           Return 1&lt;br /&gt;

&lt;br /&gt;
        Case = &quot;7 to 12 months&quot;&lt;br /&gt;

&lt;br /&gt;
           Return 2&lt;br /&gt;

&lt;br /&gt;
        Case = &quot;More than 12 months&quot;&lt;br /&gt;

&lt;br /&gt;
           Return 3&lt;br /&gt;

&lt;br /&gt;
     End Select&lt;br /&gt;

&lt;br /&gt;
End Function&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;=Code.CustomSortOrder(Fields!RAG.Value)&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/6180323364993263263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/6180323364993263263?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/6180323364993263263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/6180323364993263263'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2016/10/ssrs-custom-sort.html' title='SSRS custom sort'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-5144559926910947273</id><published>2016-06-30T15:44:00.001+01:00</published><updated>2016-06-30T15:44:19.492+01:00</updated><title type='text'>ssrs subreport background colour</title><content type='html'>Ssubreport properties. &lt;br /&gt;Select Parameters and add a parameter. &lt;br /&gt;The name column is the name of the parameter in the subreport (rowcolour) and value is the value to set it to.&lt;br /&gt;Set Value to the same expression used to set the background color for the row.&lt;br /&gt;background color =Parameters!rowcolour.Value into the expression builder.</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/5144559926910947273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/5144559926910947273?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/5144559926910947273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/5144559926910947273'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2016/06/ssrs-subreport-background-colour.html' title='ssrs subreport background colour'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-7657358301895598131</id><published>2015-04-20T11:41:00.002+01:00</published><updated>2015-04-20T11:41:57.582+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FOR XML PATH"/><category scheme="http://www.blogger.com/atom/ns#" term="Stuff"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>combine multiple rows into one</title><content type='html'>&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;LEFT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;OUTER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;JOIN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Consolas; font-size: x-small;&quot;&gt;STUFF&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;((&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;com_text&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;comm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;q1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;br /&gt;
   &lt;br /&gt;

&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;ORDER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;comseq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;ASC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;FOR&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;XML&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;PATH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;)),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: x-small;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;[Comments]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;comm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;q1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;GROUP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;Comm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;ON&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;Comm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: Consolas; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: x-small;&quot;&gt;ref&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/7657358301895598131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/7657358301895598131?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7657358301895598131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7657358301895598131'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2015/04/combine-multiple-rows-into-one.html' title='combine multiple rows into one'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-6296847051980400997</id><published>2014-05-06T11:43:00.001+01:00</published><updated>2017-05-02T11:47:02.890+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Green bar"/><category scheme="http://www.blogger.com/atom/ns#" term="Group"/><category scheme="http://www.blogger.com/atom/ns#" term="Group Header"/><category scheme="http://www.blogger.com/atom/ns#" term="Iif"/><category scheme="http://www.blogger.com/atom/ns#" term="Mod"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>Green bar for a group header - SSRS</title><content type='html'>&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;=IIF(RunningValue(Fields!xxx.Value,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;COUNTDISTINCT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;NOTHING&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;MOD&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; 2 = 1,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;White&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&quot;PaleGreen&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;=iif(RunningValue(Fields!xxx. Value,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;CountDistinct&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&quot;parentgroupname&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;Mod&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt; 2,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&quot;WhiteSmoke&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: x-small;&quot;&gt;&quot;White&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/6296847051980400997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/6296847051980400997?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/6296847051980400997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/6296847051980400997'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2014/05/green-bar-for-group-header-ssrs.html' title='Green bar for a group header - SSRS'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-2577058998928184631</id><published>2013-12-24T10:54:00.001+00:00</published><updated>2013-12-24T10:54:53.362+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Stored Procedures"/><title type='text'>List all Stored Procedures within a db - SQL</title><content type='html'>&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;         TFSheffieldNew&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;ROUTINES&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WHERE     &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ROUTINE_TYPE &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;PROCEDURE&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/2577058998928184631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/2577058998928184631?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/2577058998928184631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/2577058998928184631'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2013/12/list-all-stored-procedures-within-db-sql.html' title='List all Stored Procedures within a db - SQL'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-7051930574050120050</id><published>2013-10-28T10:43:00.001+00:00</published><updated>2013-10-28T16:57:25.820+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Auxiliary"/><category scheme="http://www.blogger.com/atom/ns#" term="CTE"/><category scheme="http://www.blogger.com/atom/ns#" term="Numbers Table"/><category scheme="http://www.blogger.com/atom/ns#" term="Row_Number"/><title type='text'>Auxiliary Numbers Table - Populated by CTE (Based on Itzik Ben-Gan)</title><content type='html'>&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;USE &lt;span style=&quot;color: black;&quot;&gt;[Auxiliary]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;

&lt;br /&gt;
SET ANSI_NULLS&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;ON &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;

&lt;br /&gt;
SET QUOTED_IDENTIFIER&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;ON&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;

&lt;br /&gt;
CREATE TABLE&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; [dbo]&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[Nums]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;span style=&quot;color: black;&quot;&gt;[n] [int] &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NULL, &lt;span style=&quot;color: blue;&quot;&gt;PRIMARY KEY&lt;span style=&quot;color: black; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;CLUSTERED&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;span style=&quot;color: black;&quot;&gt;[n]&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;ASC&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt; ))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WITH&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x00&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1 &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;UNION&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;ALL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;x02 &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1 &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x00 a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x00 b&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;x04 &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1 &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x02 a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x02 b&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;x08 &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1 &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x04 a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x04 b&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;x16 &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1 &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x08 a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x08 b&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;x32 &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1 &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x16 a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x16 b&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;cTally &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;ROW_NUMBER&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;OVER &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;ORDER&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x32&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INSERT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INTO&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Nums&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; cTally&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; n &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1000000&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Based on the CTE used here:&lt;br /&gt;
&lt;a href=&quot;http://sqlreportingservicescrystalreports.blogspot.co.uk/2009/12/auxilary-cte-of-numbers-sql.html&quot;&gt;http://sqlreportingservicescrystalreports.blogspot.co.uk/2009/12/auxilary-cte-of-numbers-sql.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/7051930574050120050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/7051930574050120050?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7051930574050120050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7051930574050120050'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2013/10/auxiliary-numbers-table-populated-by.html' title='Auxiliary Numbers Table - Populated by CTE (Based on Itzik Ben-Gan)'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-7619459070080727388</id><published>2013-01-28T10:19:00.001+00:00</published><updated>2013-01-28T10:19:43.159+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Product Key"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 R2"/><title type='text'>To obtain SQL Server 2008R2 Product Key</title><content type='html'>To obtain SQL Server 2008R2 Product Key:&lt;br /&gt;
&amp;nbsp; 
USE MASTER 
&lt;br /&gt;
&lt;br /&gt;
GO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXEC XP_REGREAD &#39;HKEY_LOCAL_MACHINE&#39;,&#39;SOFTWARE\Microsoft\Microsoft SQL Server\100\BIDS\Setup&#39;,&#39;ProductCode&#39;&lt;br /&gt;
&lt;br /&gt;
GO&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/7619459070080727388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/7619459070080727388?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7619459070080727388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7619459070080727388'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2013/01/to-obtain-sql-server-2008r2-product-key.html' title='To obtain SQL Server 2008R2 Product Key'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-4826589386856843107</id><published>2012-11-20T17:40:00.000+00:00</published><updated>2013-12-24T11:02:39.184+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Convert time to string"/><category scheme="http://www.blogger.com/atom/ns#" term="Date and Time"/><category scheme="http://www.blogger.com/atom/ns#" term="Datepart"/><category scheme="http://www.blogger.com/atom/ns#" term="Mod"/><category scheme="http://www.blogger.com/atom/ns#" term="Modular"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><category scheme="http://www.blogger.com/atom/ns#" term="Stored Procedures"/><category scheme="http://www.blogger.com/atom/ns#" term="String"/><category scheme="http://www.blogger.com/atom/ns#" term="Time"/><category scheme="http://www.blogger.com/atom/ns#" term="Time to String"/><title type='text'>Convert time to string - SQL</title><content type='html'>&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt; 
&lt;span style=&quot;color: black;&quot;&gt;Scenario where a db field contains seconds, the user wanted a SSRS report displaying various aggregates of the seconds field as Hours - Minutes - Seconds.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;IF&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;dbo.udf_SCC_TimeToString&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;IS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NOT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;DROP&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FUNCTION&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; dbo&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;udf_SCC_TimeToString &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;
&lt;br /&gt;
CREATE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FUNCTION&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; dbo&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;udf_SCC_TimeToString&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@timesec &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--input in seconds as integer&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;RETURNS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;VARCHAR&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;/*==========================================&lt;br /&gt;

&lt;br /&gt;
Dom Horton&lt;br /&gt;

&lt;br /&gt;
17/10/2012&lt;br /&gt;


&lt;br /&gt;
==========================================*/&lt;br /&gt;

&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;BEGIN&lt;br /&gt;

DECLARE&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@return &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;VARCHAR&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;@a &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;@b &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;@hours &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;@mins &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;@secs &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@a &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @timesec&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;%&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;3600 &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--get no. of seconds over the hour&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@hours &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@timesec &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;3600 &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--get no. of seconds of completed hours, divide by hour in seconds to get completed hours&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@b  &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @a &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--hold no. of secs over the hour&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@a &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @b&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;%&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--get no. of secs over the min&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@mins &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@b  &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @a&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;60 &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--get no. of seconds of completed mins, divide by min in secs to get completed minutes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@secs &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @a&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@return &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;CASE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WHEN&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @timesec &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;3600&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;THEN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@hours&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39; hr &#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@mins&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39; min &#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@secs&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39; sec &#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WHEN&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @timesec &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;60&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;THEN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@mins&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39; min &#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@secs&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39; sec &#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;ELSE&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;convert&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;varchar&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@secs&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39; sec &#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; @return&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;END&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Example below showing the Stored Procedure in use:&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK6k-RlucBCs2isWOuWkJB3fG8xV8v14Tm2H0PG9BIhrCEuUlwjofo523LLk-kTJUZuUyE1jfD6QeRqv-_BaspdMSmT4PgOAADtKHSKPDXmhsebYmbQsvtVeYaChZ4yvoBjIXv1wtpxx8L/s1600/Time+in+seconds+converted+to+string.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK6k-RlucBCs2isWOuWkJB3fG8xV8v14Tm2H0PG9BIhrCEuUlwjofo523LLk-kTJUZuUyE1jfD6QeRqv-_BaspdMSmT4PgOAADtKHSKPDXmhsebYmbQsvtVeYaChZ4yvoBjIXv1wtpxx8L/s320/Time+in+seconds+converted+to+string.PNG&quot; height=&quot;250&quot; rea=&quot;true&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;and in use in a SSRS report:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNWdyabJSgVi_e6JuEgjrraLN_PiAQB3CATMEB4tMBLe5w5LDjshSQr-jcFKcYaa4kaSQvr2HtHJDkSceexACagX7nEd1o8h8inxSVvMDX5JWbHNnfq8L154aIhyphenhyphenY1ahFmzX7czy61fK6d/s1600/SSRS+Time+in+seconds+converted+to+string.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNWdyabJSgVi_e6JuEgjrraLN_PiAQB3CATMEB4tMBLe5w5LDjshSQr-jcFKcYaa4kaSQvr2HtHJDkSceexACagX7nEd1o8h8inxSVvMDX5JWbHNnfq8L154aIhyphenhyphenY1ahFmzX7czy61fK6d/s320/SSRS+Time+in+seconds+converted+to+string.PNG&quot; height=&quot;169&quot; rea=&quot;true&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/4826589386856843107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/4826589386856843107?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4826589386856843107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4826589386856843107'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2012/11/convert-time-to-string-sql.html' title='Convert time to string - SQL'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK6k-RlucBCs2isWOuWkJB3fG8xV8v14Tm2H0PG9BIhrCEuUlwjofo523LLk-kTJUZuUyE1jfD6QeRqv-_BaspdMSmT4PgOAADtKHSKPDXmhsebYmbQsvtVeYaChZ4yvoBjIXv1wtpxx8L/s72-c/Time+in+seconds+converted+to+string.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-4398711258380046577</id><published>2012-09-06T14:06:00.000+01:00</published><updated>2012-09-06T14:06:22.460+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Index"/><category scheme="http://www.blogger.com/atom/ns#" term="Missing Indexes"/><category scheme="http://www.blogger.com/atom/ns#" term="Perfomance"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 R2"/><category scheme="http://www.blogger.com/atom/ns#" term="sys.dm_db_missing_index_details"/><title type='text'>Missing indexes - SQL </title><content type='html'>SELECT index_handle, database_id, object_id, equality_columns, inequality_columns, included_columns, statement 
&lt;br /&gt;
&lt;br /&gt;
FROM sys.dm_db_missing_index_details 
</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/4398711258380046577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/4398711258380046577?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4398711258380046577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4398711258380046577'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2012/09/missing-indexes-sql.html' title='Missing indexes - SQL '/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-7655329724745503453</id><published>2012-09-06T14:05:00.000+01:00</published><updated>2012-09-06T14:06:39.352+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Index"/><category scheme="http://www.blogger.com/atom/ns#" term="Index usage"/><category scheme="http://www.blogger.com/atom/ns#" term="Perfomance"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 R2"/><category scheme="http://www.blogger.com/atom/ns#" term="sys.dm_db_index_usage_stats"/><category scheme="http://www.blogger.com/atom/ns#" term="sys.indexes"/><title type='text'>Index usage - SQL</title><content type='html'>SELECT OBJECT_NAME(I.object_id) AS TableName, I.name, I.index_id, I.type_desc, I.is_unique, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I.fill_factor, I.is_padded, I.is_disabled, I.is_hypothetical, &lt;br /&gt;
&lt;br /&gt;
IUS.index_id , IUS.user_seeks, IUS.user_scans, IUS.user_lookups, IUS.user_updates, IUS.last_user_seek, &lt;br /&gt;
&lt;br /&gt;
IUS.last_user_scan, IUS.last_user_lookup, IUS.last_user_update, IUS.system_seeks, IUS.system_scans, IUS.system_lookups, IUS.system_updates, &lt;br /&gt;
&lt;br /&gt;
IUS.last_system_seek, IUS.last_system_scan, IUS.last_system_lookup, IUS.last_system_update&lt;br /&gt;
&lt;br /&gt;
FROM sys.indexes AS I LEFT OUTER JOIN&lt;br /&gt;
&lt;br /&gt;
sys.dm_db_index_usage_stats AS IUS &lt;br /&gt;
&lt;br /&gt;
ON I.object_id = IUS.object_id AND&lt;br /&gt;
&lt;br /&gt;
I.index_id = IUS.index_id&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ORDER BY OBJECT_NAME(I.object_id)</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/7655329724745503453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/7655329724745503453?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7655329724745503453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7655329724745503453'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2012/09/index-usage-sql.html' title='Index usage - SQL'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-1381103109784197922</id><published>2012-08-08T10:22:00.003+01:00</published><updated>2012-08-08T10:22:32.744+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Function"/><category scheme="http://www.blogger.com/atom/ns#" term="Green bar"/><category scheme="http://www.blogger.com/atom/ns#" term="Iif"/><category scheme="http://www.blogger.com/atom/ns#" term="Mod"/><category scheme="http://www.blogger.com/atom/ns#" term="rownumber"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Reporting Services"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><category scheme="http://www.blogger.com/atom/ns#" term="Switch"/><title type='text'>Useful SSRS expression syntax</title><content type='html'>=IIF(Fields!a.value&amp;gt;100, True, False)&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------&lt;br /&gt;
=IIF(Fields!a.value &amp;gt;=10, &quot;Green&quot;, IIF(Fields!a.value &amp;gt;=1, &quot;Blue&quot;, &quot;Red&quot;))&lt;br /&gt;
&lt;br /&gt;
values &amp;gt;=10 are green, between 1 &amp;amp; 9 are blue, less than 1 are red&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
=SWITCH(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Fields!a.value &amp;gt;=10, &quot;green&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Fields!a.value &amp;gt;=1, &quot;blue&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Fields!a.value = 1, &quot;yellow&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Fields!a.value &amp;lt;=0, &quot;Red&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;gt;=10 are green, between 1 &amp;amp; 9 blue, =1 yellow, &amp;lt;=0 red&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
SWITCH function finds the first expression that&#39;s true. It will not catch errors further along.&lt;br /&gt;
IIF function evaluates all parts of the expression.&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=IIF(Rownumber(&quot;scope&quot;) Mod 2 = 0, &quot;Khaki&quot;, &quot;White&quot;)&lt;br /&gt;
&lt;br /&gt;
set &quot;scope&quot; to reset row colours for every group&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/1381103109784197922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/1381103109784197922?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/1381103109784197922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/1381103109784197922'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2012/08/useful-ssrs-expression-syntax.html' title='Useful SSRS expression syntax'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-7821586114572785393</id><published>2011-10-06T13:39:00.001+01:00</published><updated>2011-10-06T13:40:55.975+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aggregate"/><category scheme="http://www.blogger.com/atom/ns#" term="Cast"/><category scheme="http://www.blogger.com/atom/ns#" term="Count"/><category scheme="http://www.blogger.com/atom/ns#" term="Msg 409"/><category scheme="http://www.blogger.com/atom/ns#" term="uniqueidentifier"/><title type='text'>Using Count function on a uniqueidentifier field - SQL</title><content type='html'>&lt;span style=&quot;font-size: x-small;&quot;&gt;SELECT&lt;span style=&quot;color: magenta;&quot;&gt; COUNT&lt;/span&gt;(D.DOCUMENTID) &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; DocCount, P.TITLE&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; DOCUMENT &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; D &lt;span style=&quot;color: #666666;&quot;&gt;inner join&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;PROJECT &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; P &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; D.PROJECTID&lt;span style=&quot;color: #666666;&quot;&gt; =&lt;/span&gt; P.PROJECTID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GROUP BY&lt;/span&gt; P.PROJECTID, P.TITLE&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
When running this query I encountered the following error:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Msg 409, Level 16, State 2, Line 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;The count aggregate operation cannot take a uniqueidentifier data type as an argument.&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlwitZBXeJv_oondJ0mKYSvegGWuW9JFtf0AjfaoCn6V7A9zsJV5mkxoNFv2aNw1hGbZCr0JZ-LneOzK34eBaDbbzdpoyLiN3pDk6-m1P3L-Dus4mTDHB0zz2Dlo3Xv3C3y6kn9sOxdbvu/s1600/sql+count+uniqueidentifier+409+error.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;116&quot; kca=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlwitZBXeJv_oondJ0mKYSvegGWuW9JFtf0AjfaoCn6V7A9zsJV5mkxoNFv2aNw1hGbZCr0JZ-LneOzK34eBaDbbzdpoyLiN3pDk6-m1P3L-Dus4mTDHB0zz2Dlo3Xv3C3y6kn9sOxdbvu/s320/sql+count+uniqueidentifier+409+error.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
To avoid&amp;nbsp;this error&amp;nbsp;when trying to Count a uniqueidetifier field you&amp;nbsp;have to CAST it&amp;nbsp;into a char&amp;nbsp;: &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;SELECT&lt;span style=&quot;color: magenta;&quot;&gt; COUNT&lt;/span&gt;(&lt;span style=&quot;color: magenta;&quot;&gt;CAST&lt;/span&gt;(D.DOCUMENTID &lt;span style=&quot;color: blue;&quot;&gt;AS char&lt;/span&gt;(36))) &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; DocCount, P.TITLE&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; DOCUMENT &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; D &lt;span style=&quot;color: #666666;&quot;&gt;inner join&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;PROJECT &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; P &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; D.PROJECTID&lt;span style=&quot;color: #666666;&quot;&gt; =&lt;/span&gt; P.PROJECTID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;GROUP BY&lt;/span&gt; P.PROJECTID, P.TITLE&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA1Jw-kg9Ck0wi-DGgZ-pVVTdT6UOpRfLVtEjxb4d9vcG62ZFsOmIf-YhI1Qo3ZgbS9HZ7Rv3840EHP613kI6QU8QP3PRAUDQIk7Nxhbdzxq9lHGHEUvPU9ZT3l1JNa2_J45Y4N8gRT4bx/s1600/sql+count+uniqueidentifier+cast+as+char.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;163&quot; kca=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA1Jw-kg9Ck0wi-DGgZ-pVVTdT6UOpRfLVtEjxb4d9vcG62ZFsOmIf-YhI1Qo3ZgbS9HZ7Rv3840EHP613kI6QU8QP3PRAUDQIk7Nxhbdzxq9lHGHEUvPU9ZT3l1JNa2_J45Y4N8gRT4bx/s320/sql+count+uniqueidentifier+cast+as+char.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/7821586114572785393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/7821586114572785393?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7821586114572785393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7821586114572785393'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/10/using-count-function-on.html' title='Using Count function on a uniqueidentifier field - SQL'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlwitZBXeJv_oondJ0mKYSvegGWuW9JFtf0AjfaoCn6V7A9zsJV5mkxoNFv2aNw1hGbZCr0JZ-LneOzK34eBaDbbzdpoyLiN3pDk6-m1P3L-Dus4mTDHB0zz2Dlo3Xv3C3y6kn9sOxdbvu/s72-c/sql+count+uniqueidentifier+409+error.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-779666310619261330</id><published>2011-09-29T10:31:00.001+01:00</published><updated>2011-10-04T11:16:59.969+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="A3"/><category scheme="http://www.blogger.com/atom/ns#" term="InteractiveHeight"/><category scheme="http://www.blogger.com/atom/ns#" term="InteractiveSize"/><category scheme="http://www.blogger.com/atom/ns#" term="Landscape"/><category scheme="http://www.blogger.com/atom/ns#" term="Layout"/><category scheme="http://www.blogger.com/atom/ns#" term="page size"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>A3 Landscape dashboard layout - SSRS</title><content type='html'>For A3 Landscape dashboard style settings:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Report Properties:&lt;/b&gt;&lt;br /&gt;
Grid Spacing&amp;nbsp;&lt;b&gt; &lt;/b&gt;0.2cm&lt;br /&gt;
&lt;br /&gt;
InteractiveSize&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Width&amp;nbsp; 42cm&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Height&amp;nbsp; 0cm&lt;br /&gt;
&lt;br /&gt;
Margin all 0.5cm&lt;br /&gt;
&lt;br /&gt;
PageSize&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Width&amp;nbsp; 42cm&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Height&amp;nbsp; 29.7cm&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Body Properties:&lt;/b&gt;&lt;br /&gt;
Size&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Width&amp;nbsp; 41cm&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Height&amp;nbsp; 28.7cm&lt;br /&gt;
&amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/779666310619261330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/779666310619261330?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/779666310619261330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/779666310619261330'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/09/a3-landscape-dashboard-layout-ssrs.html' title='A3 Landscape dashboard layout - SSRS'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-569119080822235171</id><published>2011-09-05T09:40:00.000+01:00</published><updated>2011-09-05T09:40:37.645+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Connectivity"/><category scheme="http://www.blogger.com/atom/ns#" term="IIS"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2005"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>Resolving Common Connectivity Issues</title><content type='html'>Useful link to resolving common connectivity issues. Applies to SSAS but also proves to be of use with IIS, SSRS &amp;amp; SQL Server.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/cc917670.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/cc917670.aspx&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/569119080822235171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/569119080822235171?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/569119080822235171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/569119080822235171'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/09/resolving-common-connectivity-issues.html' title='Resolving Common Connectivity Issues'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-7129183825421327862</id><published>2011-08-16T10:50:00.000+01:00</published><updated>2011-08-16T10:50:57.367+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CR"/><category scheme="http://www.blogger.com/atom/ns#" term="Crystal Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="Perfomance"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Commands"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql Server Management Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Profiler"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL:BatchCompleted"/><category scheme="http://www.blogger.com/atom/ns#" term="Subreport"/><title type='text'>Performance of SQL commands and subreports in Crysal Reports - CR</title><content type='html'>I&#39;ve been recently attempting to imrpove the performance of a number of &#39;legacy&#39; Crystal Reports. One in question contained approximately 7 subreports with the main report returning 300+ records. I saw this an ideal candidate for using&amp;nbsp;solely a&amp;nbsp;SQL command.&lt;br /&gt;
&lt;br /&gt;
I&#39;d re-written the Crystal using said SQL command and then compared the performance of both existing subreport and new SQL command versions using SQL Server Profiler.&lt;br /&gt;
&lt;br /&gt;
The first image shows the existing subreport version:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg01CLRP6SbdLXTBZR3SLJ6CXM_UEnc45piMEND4zg4qbH149FskHpF4MJFtsQhfDDJu1XKNbQe88lGrIjmK5F6eN_EKZDSO-h9MDv-vBDyWXTWXea5gTcpSTQ8sL4Cc1Du6esb1h2qpCWV/s1600/Profiler+subreport.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;118&quot; naa=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg01CLRP6SbdLXTBZR3SLJ6CXM_UEnc45piMEND4zg4qbH149FskHpF4MJFtsQhfDDJu1XKNbQe88lGrIjmK5F6eN_EKZDSO-h9MDv-vBDyWXTWXea5gTcpSTQ8sL4Cc1Du6esb1h2qpCWV/s320/Profiler+subreport.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The second shows the SQL command version:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7drevP-ZQ_ZvuCU0jq3WV-H7a4Gbi0cQxISBpTrnNVz_rQXQEnr1U_Gcdgs6QaO5IXWZIWvdru3Ko5yBDLYTzfFjvAOKRd5uconCUu3eirq8ckw6vD0dPrYbpFAt3s1rtlEk01qr7gVXu/s1600/Profiler+sql+command.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;41&quot; naa=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7drevP-ZQ_ZvuCU0jq3WV-H7a4Gbi0cQxISBpTrnNVz_rQXQEnr1U_Gcdgs6QaO5IXWZIWvdru3Ko5yBDLYTzfFjvAOKRd5uconCUu3eirq8ckw6vD0dPrYbpFAt3s1rtlEk01qr7gVXu/s320/Profiler+sql+command.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I was surprised to see the values returned by the SQL command version which seemed vastly larger than the sum of all the &#39;subreport&#39; performance values. But, on closer inspection I realised that the subreport was only returning data for the first page in Crystal Reports whereas the SQL version was gleaning all the database info in 1 go. &lt;br /&gt;
&lt;br /&gt;
The below image shows the performance of the subreport version when the user refreshes the report on page one and subsequently moves to page two (page one returns two main report rows whereas page report returns three).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOz7UjjZBsNoBeuS2E5zmIkF8QsBI1czUyEctgbMNP6Qvm7MdIOP2LcrVpzedQhHsbtbDmYZLSInhSiJeOQaSoyilN5lVId2GTOpuaQeXmG3382rSYBK_R0wwJ7PKenG7f11YHIUORYSnO/s1600/Profiler+subreport+subsequent+pages.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; naa=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOz7UjjZBsNoBeuS2E5zmIkF8QsBI1czUyEctgbMNP6Qvm7MdIOP2LcrVpzedQhHsbtbDmYZLSInhSiJeOQaSoyilN5lVId2GTOpuaQeXmG3382rSYBK_R0wwJ7PKenG7f11YHIUORYSnO/s320/Profiler+subreport+subsequent+pages.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;As this report contains over&amp;nbsp;70 pages it is plain to see that using the subreport version the database would be queried multiple times and&amp;nbsp;incur all the&amp;nbsp;related network traffic.&amp;nbsp;It is thus&amp;nbsp;beneficial to go with the SQL command version (as originally expected!). Summing up all the CPU and read and writes also confirms this.&lt;br /&gt;
&lt;br /&gt;
One concern that I&#39;ve been unable to resolve is that Crystal Report seems to create two SQL batches when using a SQL command&amp;nbsp;thus doubling the performance overheads. The same query when run in SQL Server Management Studio records only 1 SQL batch as expected. I need to look into this as I&#39;m not fully sure why this is occuring.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwczF2qpj71Lp2wxn4ExEWDS68VMA_IXrYmJzaPIpDUJJ1qn5RP8pNDW6xLd8R1xNHGGnbS7sr_Z_TLTQ2rhQySr5zSCAeMM5DxBVC54vrvIn76nwEPA7D-d7mklMrTzosOlVEnI4iS9rx/s1600/Profiler+sql+command+2+batches.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;41&quot; naa=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwczF2qpj71Lp2wxn4ExEWDS68VMA_IXrYmJzaPIpDUJJ1qn5RP8pNDW6xLd8R1xNHGGnbS7sr_Z_TLTQ2rhQySr5zSCAeMM5DxBVC54vrvIn76nwEPA7D-d7mklMrTzosOlVEnI4iS9rx/s320/Profiler+sql+command+2+batches.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/7129183825421327862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/7129183825421327862?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7129183825421327862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/7129183825421327862'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/08/performance-of-sql-commands-and.html' title='Performance of SQL commands and subreports in Crysal Reports - CR'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg01CLRP6SbdLXTBZR3SLJ6CXM_UEnc45piMEND4zg4qbH149FskHpF4MJFtsQhfDDJu1XKNbQe88lGrIjmK5F6eN_EKZDSO-h9MDv-vBDyWXTWXea5gTcpSTQ8sL4Cc1Du6esb1h2qpCWV/s72-c/Profiler+subreport.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-8753698896542393142</id><published>2011-06-03T09:57:00.001+01:00</published><updated>2011-08-11T11:26:48.759+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Add Command"/><category scheme="http://www.blogger.com/atom/ns#" term="CR"/><category scheme="http://www.blogger.com/atom/ns#" term="Crystal Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Commands"/><category scheme="http://www.blogger.com/atom/ns#" term="Subreport"/><category scheme="http://www.blogger.com/atom/ns#" term="uniqueidentifier"/><title type='text'>Using SQL commands, parameters and subreports - CR</title><content type='html'>My report contains a number of subreports, each comprising a SQL command and using a parameter value passed from the main report.&lt;br /&gt;
&lt;br /&gt;
1) Set up the main report parameter, in this instance called ?School&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;border: currentColor; clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKXeRJhtYZFH7xi0UPqwLfUrO7ntT6vGBcgrTwkqBzyQ1CsIocSJaQ6q5OLByBQHf_g3ZvuGePawyQtctsKaZBLoGx4DAdnKuVgoNCZUE-PM21vfE7weCB8gpQZiK8bVnT8fzBMMXzPBRT/s1600/Main+report+parameter.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKXeRJhtYZFH7xi0UPqwLfUrO7ntT6vGBcgrTwkqBzyQ1CsIocSJaQ6q5OLByBQHf_g3ZvuGePawyQtctsKaZBLoGx4DAdnKuVgoNCZUE-PM21vfE7weCB8gpQZiK8bVnT8fzBMMXzPBRT/s320/Main+report+parameter.PNG&quot; t8=&quot;true&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Add a subreport, Add Command with the Where clause as follows:&lt;br /&gt;
&lt;br /&gt;
WHERE (School.SchoolKey = {?School})&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;border: currentColor; clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;border: currentColor; clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilkIy4Kx-IUEzDpegCUfB0haW-PaMZ8XYmrApRMWHv80Uocs8xt5APcXPCEp_Xj5yLU49AC7VEBqrndviSUprhuxpftk0Au_yTrxFyfRx75RvcMliUb6IuNMtsPtNgpCoWYEYQ85dStsuL/s1600/subreport+sql+command+parameter.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;203&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilkIy4Kx-IUEzDpegCUfB0haW-PaMZ8XYmrApRMWHv80Uocs8xt5APcXPCEp_Xj5yLU49AC7VEBqrndviSUprhuxpftk0Au_yTrxFyfRx75RvcMliUb6IuNMtsPtNgpCoWYEYQ85dStsuL/s320/subreport+sql+command+parameter.PNG&quot; t8=&quot;true&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) For the Parameter list, Click Create:&lt;br /&gt;
&lt;br /&gt;
Parameter Name = School&lt;br /&gt;
Value Type = Number&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;border: currentColor; clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp5MW3ZAGTd6p7C3j5cBoZQdmi6B64IxuiUGDs_59T4apojn-Sh3dnU6Hl2LM-Riz9xiiSglp8AdjBe-Co6idDB9N06o736KDSydERairkTW_Eivk7qhcufZ8hJNuuGms6b8Vv5zzohOqH/s1600/subreport+sql+command+parameter+detail.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;243&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp5MW3ZAGTd6p7C3j5cBoZQdmi6B64IxuiUGDs_59T4apojn-Sh3dnU6Hl2LM-Riz9xiiSglp8AdjBe-Co6idDB9N06o736KDSydERairkTW_Eivk7qhcufZ8hJNuuGms6b8Vv5zzohOqH/s320/subreport+sql+command+parameter+detail.PNG&quot; t8=&quot;true&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It will then prompt for a parameter value, enter 1 (anything will suffice at this stage)&lt;br /&gt;
&lt;br /&gt;
NOTE: When the database field is a uniqueidentifier, use &#39;String&#39; type and for the prompt&amp;nbsp;use a value in the&amp;nbsp;uniqueidenfier format: &lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;{29D2B899-393A-4592-9B00-D289884A1F94}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
4) Back in the main report, right click the subreport and Change Subreport Links:&lt;br /&gt;
&lt;br /&gt;
Available Fields = ?School&lt;br /&gt;
Subreport parameter field to use = ?School (make sure to select the user-generated one and not the automatically generated one named similar to ?PM-?School)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;border: currentColor; clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-VZkHJNkl9rSkMYcND-s2wPhcmvD3aFrjil9_FHMdgQJ_bzVV8vlgRZ3EsTil2SvT6P6t03OZvWvzc6asLDKUyOKX24ZhZIFBOqk6Xtf5MSGWjo3bBnUPdaORHVMzeuTL7OmCuiIBNo_l/s1600/Subreport+Links+parameter.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-VZkHJNkl9rSkMYcND-s2wPhcmvD3aFrjil9_FHMdgQJ_bzVV8vlgRZ3EsTil2SvT6P6t03OZvWvzc6asLDKUyOKX24ZhZIFBOqk6Xtf5MSGWjo3bBnUPdaORHVMzeuTL7OmCuiIBNo_l/s320/Subreport+Links+parameter.PNG&quot; t8=&quot;true&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Voila! Main report parameters should now be passed to SQL Commands in subreports.</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/8753698896542393142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/8753698896542393142?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/8753698896542393142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/8753698896542393142'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/06/using-sql-commands-parameters-and.html' title='Using SQL commands, parameters and subreports - CR'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKXeRJhtYZFH7xi0UPqwLfUrO7ntT6vGBcgrTwkqBzyQ1CsIocSJaQ6q5OLByBQHf_g3ZvuGePawyQtctsKaZBLoGx4DAdnKuVgoNCZUE-PM21vfE7weCB8gpQZiK8bVnT8fzBMMXzPBRT/s72-c/Main+report+parameter.PNG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-8929472777916262444</id><published>2011-03-16T13:10:00.000+00:00</published><updated>2011-03-16T13:10:34.557+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="parameter label field"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Reporting Services"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>Display parameter Label field - SSRS</title><content type='html'>I was familiar with displaying a parameter&#39;s value field by using the expression:&lt;br /&gt;
&amp;nbsp;=Parameters!parameterfield.Value&lt;br /&gt;
&lt;br /&gt;
But in many cases this value will be a key field and pointless to display. The &#39;Label&#39; field is required and is obtained by simply changing the expression to:&lt;br /&gt;
=Parameters!parameterfield.Label&lt;br /&gt;
&lt;br /&gt;
Simple and obvious&amp;nbsp;really!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRoHfgRgHu9-ITVzgCjgEHavwP2fnuG5YImp6pbW4BzVey84g-WkY2fWNCHu9ErsxtiEx7QfCiXoKp5gLTVF7PcXc8QeE-fx_tZbGXSoNZBfPDjIO3-ibJGzVPD6V4W3Oq_xxZQN8dZGEQ/s1600/ssrs+parameter+label+field.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; r6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRoHfgRgHu9-ITVzgCjgEHavwP2fnuG5YImp6pbW4BzVey84g-WkY2fWNCHu9ErsxtiEx7QfCiXoKp5gLTVF7PcXc8QeE-fx_tZbGXSoNZBfPDjIO3-ibJGzVPD6V4W3Oq_xxZQN8dZGEQ/s320/ssrs+parameter+label+field.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/8929472777916262444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/8929472777916262444?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/8929472777916262444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/8929472777916262444'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/03/display-parameter-label-field-ssrs.html' title='Display parameter Label field - SSRS'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRoHfgRgHu9-ITVzgCjgEHavwP2fnuG5YImp6pbW4BzVey84g-WkY2fWNCHu9ErsxtiEx7QfCiXoKp5gLTVF7PcXc8QeE-fx_tZbGXSoNZBfPDjIO3-ibJGzVPD6V4W3Oq_xxZQN8dZGEQ/s72-c/ssrs+parameter+label+field.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-4982209553130955662</id><published>2011-03-09T15:39:00.000+00:00</published><updated>2011-03-09T15:39:45.437+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CHECKSUM"/><category scheme="http://www.blogger.com/atom/ns#" term="CHECKSUM(NEWID())"/><category scheme="http://www.blogger.com/atom/ns#" term="NEWID()"/><category scheme="http://www.blogger.com/atom/ns#" term="RAND()"/><category scheme="http://www.blogger.com/atom/ns#" term="random"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Return a random row - SQL</title><content type='html'>Instead of using the RAND() function which I believe is not truly random since using the same seed value results in the same output:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiUsJKyvvTYA0kA0FHfmx5G41z-4wHvw3eSYJatdUpByzcJEPbb0S6zHUbMppygLaNroA9RwXeAUe7ibGCq4R3fDOdhi2xP-4EaketPlbymdXzUgzyoAWUVgF9hhfpoUHpfaVZZFuEWXMR/s1600/SQL+RAND.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; q6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiUsJKyvvTYA0kA0FHfmx5G41z-4wHvw3eSYJatdUpByzcJEPbb0S6zHUbMppygLaNroA9RwXeAUe7ibGCq4R3fDOdhi2xP-4EaketPlbymdXzUgzyoAWUVgF9hhfpoUHpfaVZZFuEWXMR/s200/SQL+RAND.PNG&quot; width=&quot;104&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Whereas, CHECKSUM(NEWID()) would work:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgix3RS2iFheV_uHbjWQKm_-iqnMvxbLkctrufBQs3K_7LoFCB7BnH9TM19lxxNDO6318ZvRV1xeLSNk_botMWOJuMLgiDS7IQE0qiV6W4VRqhvwyTPmSWff456KG0PwmSZjj5MlHpXVoae/s1600/SQL+CHECKSUM+NEWID.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; q6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgix3RS2iFheV_uHbjWQKm_-iqnMvxbLkctrufBQs3K_7LoFCB7BnH9TM19lxxNDO6318ZvRV1xeLSNk_botMWOJuMLgiDS7IQE0qiV6W4VRqhvwyTPmSWff456KG0PwmSZjj5MlHpXVoae/s200/SQL+CHECKSUM+NEWID.PNG&quot; width=&quot;139&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;&quot;&gt;&lt;br /&gt;
and can thus be used to return a random row:&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;TOP&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; School&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SchoolName&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; School &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;ORDER &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;CHECKSUM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;NEWID&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;());&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPsWJrcedtU5soxljZ-NDBD_XouLcF4eYEu44bTaNtRnqTmdT9pkH9vRXGQOOowz9W3wnkunBuvQIO-MM-d0Qs8YqTh0Q9_VQ4JwTfcO3o94xUXXjU18UtbS4xMkA-jzNifA27HkaKknJr/s1600/SQL+SELECT+random+CHECKSUM+NEWID.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; q6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPsWJrcedtU5soxljZ-NDBD_XouLcF4eYEu44bTaNtRnqTmdT9pkH9vRXGQOOowz9W3wnkunBuvQIO-MM-d0Qs8YqTh0Q9_VQ4JwTfcO3o94xUXXjU18UtbS4xMkA-jzNifA27HkaKknJr/s320/SQL+SELECT+random+CHECKSUM+NEWID.PNG&quot; width=&quot;182&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/4982209553130955662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/4982209553130955662?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4982209553130955662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/4982209553130955662'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/03/return-random-row-sql.html' title='Return a random row - SQL'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiUsJKyvvTYA0kA0FHfmx5G41z-4wHvw3eSYJatdUpByzcJEPbb0S6zHUbMppygLaNroA9RwXeAUe7ibGCq4R3fDOdhi2xP-4EaketPlbymdXzUgzyoAWUVgF9hhfpoUHpfaVZZFuEWXMR/s72-c/SQL+RAND.PNG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-6744098840384902275</id><published>2011-02-15T15:59:00.000+00:00</published><updated>2011-02-15T15:59:30.007+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Diana Lite"/><category scheme="http://www.blogger.com/atom/ns#" term="Nob Hill Software"/><title type='text'>Nob Hill Software - Useful information we can get out of a query execution</title><content type='html'>Here&#39;s a guest article by Nob Hill Software. &lt;a href=&quot;http://www.nobhillsoft.com/&quot;&gt;http://www.nobhillsoft.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Much has been written about Query Execution Plans (we’ll call them QEPs), and how they can be used for analyzing how SQL Server interprets your TSQL code and what it does behind the scenes –&lt;br /&gt;
information you can use to do such things as find bottlenecks, build indexes where they might help, and generally improve the performance of your code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Well, we have found more uses for it. There is more information in the QEP, information that’s not typically used, yet is highly useful and very easy to retrieve:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;1. IS YOUR CODE BROKEN?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
TSQL code can get ‘broken’ all the time. You might be referencing tables or columns that don’t exist.&lt;br /&gt;
They might have even existed at the time you wrote the procedure, but have been removed since, leaving your procedure ‘broken’ - It will raise an error next time its executed. How many of those do YOU have in your database?&lt;br /&gt;
&lt;br /&gt;
Now, if a code is broken, SQL Server will let you know about that when attempting to retrieve its execution plan. Strictly speaking, this is not QEP information. Its information you will get while trying to get the QEP. And that is not the only way to get that information. But it’s the easiest.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;2. WHAT ENTITIES ARE USED IN FOR WHAT OPERATION?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Among all the logical and physical operations, and effects on memory etc, QEP also contains the very basic information of what entities it is working with, and what it does on such entities. This information can be then used to build a basic ‘browser database’, which you can use to answer questions like: which code inserts to this table? I got data missing… which procedure removes records from here?&lt;br /&gt;
&lt;br /&gt;
In order to get any SQL’s execution plan in SQL Server, all you need to do is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
set SHOWPLAN_ALL on&lt;br /&gt;
write your SQL here&lt;br /&gt;
set SHOWPLAN_ALL on&lt;br /&gt;
&lt;br /&gt;
If you get an error, this means the stored procedure is broken, and the error would say why.&lt;br /&gt;
Otherwise, you can get the execution plan in a tabular format, and retrieve the specific entities used from it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We put this functionality into one of our freebie products, Diana Lite. You can build the full ‘browser database’ out of the collection of any database’s SQL Code, then easily filter it and get to whatever you are looking for:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeA5snSgsb0dhIwUUYTn3iELnGo1aHCNFnWOg3qZfgiQqUeWr3lV9oBOv1IVusPRnM8Vh9P8bljicWMibXwYxe8GdHx7KTAGnzgoCil2PFmNsjzAhPr6t0uwhcWII4xrf2y47sKPFCqkA7/s1600/QEP_BrowserDB.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; h5=&quot;true&quot; height=&quot;121&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeA5snSgsb0dhIwUUYTn3iELnGo1aHCNFnWOg3qZfgiQqUeWr3lV9oBOv1IVusPRnM8Vh9P8bljicWMibXwYxe8GdHx7KTAGnzgoCil2PFmNsjzAhPr6t0uwhcWII4xrf2y47sKPFCqkA7/s320/QEP_BrowserDB.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sweet, Huh? &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;a href=&quot;http://www.nobhillsoft.com/Freebies.aspx&quot;&gt;http://www.nobhillsoft.com/Freebies.aspx&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/6744098840384902275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/6744098840384902275?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/6744098840384902275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/6744098840384902275'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/02/nob-hill-software-useful-information-we.html' title='Nob Hill Software - Useful information we can get out of a query execution'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeA5snSgsb0dhIwUUYTn3iELnGo1aHCNFnWOg3qZfgiQqUeWr3lV9oBOv1IVusPRnM8Vh9P8bljicWMibXwYxe8GdHx7KTAGnzgoCil2PFmNsjzAhPr6t0uwhcWII4xrf2y47sKPFCqkA7/s72-c/QEP_BrowserDB.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1661221027110337510.post-8874231882720988943</id><published>2011-01-19T15:06:00.003+00:00</published><updated>2011-05-25T10:47:17.703+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CR"/><category scheme="http://www.blogger.com/atom/ns#" term="CurrentDate"/><category scheme="http://www.blogger.com/atom/ns#" term="CurrentDateTime"/><category scheme="http://www.blogger.com/atom/ns#" term="dateserial"/><category scheme="http://www.blogger.com/atom/ns#" term="end of year"/><category scheme="http://www.blogger.com/atom/ns#" term="financial year"/><category scheme="http://www.blogger.com/atom/ns#" term="fiscal year"/><category scheme="http://www.blogger.com/atom/ns#" term="start of year"/><title type='text'>FInd current financial year start and end dates - CR</title><content type='html'>To find the start date and finish date of the current financial year for subsequent use in various calculations:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Start of year formula:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Local Datetimevar&lt;/span&gt; dates := &lt;span style=&quot;color: blue;&quot;&gt;CURRENTDATETIME&lt;/span&gt;();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Local Datetimevar&lt;/span&gt; startfinancialyear;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;IF MONTH&lt;/span&gt;(dates)&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;IN&lt;/span&gt; [1,2,3]&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;THEN &lt;/span&gt;startfinancialyear := (&lt;span style=&quot;color: blue;&quot;&gt;DATESERIAL&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;YEAR&lt;/span&gt;(dates)-1,4,1))&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ELSE &lt;/span&gt;startfinancialyear := (&lt;span style=&quot;color: blue;&quot;&gt;DATESERIAL&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;YEAR&lt;/span&gt;(dates),4,1));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;End of year formula:&lt;/strong&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Local Datetimevar&lt;/span&gt; dates := &lt;span style=&quot;color: blue;&quot;&gt;CURRENTDATETIME&lt;/span&gt;(); &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Local Datetimevar&lt;/span&gt; endfinancialyear;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;IF MONTH&lt;/span&gt;(dates)&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;IN&lt;/span&gt; [1,2,3]&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;THEN &lt;/span&gt;endfinancialyear := (&lt;span style=&quot;color: blue;&quot;&gt;DATESERIAL&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;YEAR&lt;/span&gt;(dates),3,31))&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ELSE &lt;/span&gt;endfinancialyear := (&lt;span style=&quot;color: blue;&quot;&gt;DATESERIAL&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;YEAR&lt;/span&gt;(dates)+1,3,31));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alteration: The End of year formula gets the last day of the financial year, i.e. 31st March. However, it returns the value for the very start of the day (31/03/xxxx 00:00:00) which when incorporated into a selection formula&amp;nbsp;could potential lead to records logged&amp;nbsp;during that final day being excluded.&lt;br /&gt;
&lt;br /&gt;
A correction would be:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;End of year formula (correction):&lt;/strong&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Local Datetimevar&lt;/span&gt; dates := &lt;span style=&quot;color: blue;&quot;&gt;CURRENTDATETIME&lt;/span&gt;(); &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Local Datetimevar&lt;/span&gt; endfinancialyear;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;IF MONTH&lt;/span&gt;(dates)&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;IN&lt;/span&gt; [1,2,3]&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;THEN &lt;/span&gt;endfinancialyear := &lt;span style=&quot;color: blue;&quot;&gt;DATEADD&lt;/span&gt;(&quot;s&quot; , -1,&amp;nbsp;(&lt;span style=&quot;color: blue;&quot;&gt;DATESERIAL&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;YEAR&lt;/span&gt;(dates),4,1)))&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ELSE &lt;/span&gt;endfinancialyear := &lt;span style=&quot;color: blue;&quot;&gt;DATEADD&lt;/span&gt;(&quot;s&quot; , -1,&amp;nbsp;(&lt;span style=&quot;color: blue;&quot;&gt;DATESERIAL&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;YEAR&lt;/span&gt;(dates)+1,4,1)));&lt;br /&gt;
&lt;br /&gt;
Thus, returning a value of &quot;31/03/xxxx 23:59:59&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;&quot;&gt;(Currently set up for use in the UK)&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoHDLmc5mNQoJi9kDjpD1auOsQmem3Ymc6emr1XgWEWjk7Xk7ctBpbopwtJYGHAHOKpa9R34usN48hlo1Lyf8h_vJ13_mTq1SNFBUjYsqW6FgnhB0KCzv7J-HHPVJaC6ZSxxhcTraOR0oh/s1600/financial+year+by+Country.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;251&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoHDLmc5mNQoJi9kDjpD1auOsQmem3Ymc6emr1XgWEWjk7Xk7ctBpbopwtJYGHAHOKpa9R34usN48hlo1Lyf8h_vJ13_mTq1SNFBUjYsqW6FgnhB0KCzv7J-HHPVJaC6ZSxxhcTraOR0oh/s320/financial+year+by+Country.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlreportingservicescrystalreports.blogspot.com/feeds/8874231882720988943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1661221027110337510/8874231882720988943?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/8874231882720988943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1661221027110337510/posts/default/8874231882720988943'/><link rel='alternate' type='text/html' href='http://sqlreportingservicescrystalreports.blogspot.com/2011/01/find-current-financial-year-start-and.html' title='FInd current financial year start and end dates - CR'/><author><name>Dom Horton</name><uri>http://www.blogger.com/profile/04194530098048137883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='22' src='http://3.bp.blogspot.com/_mCjyv6ByaiI/SPo4qeodyTI/AAAAAAAAAuM/_7j5uIgFID8/S220/1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoHDLmc5mNQoJi9kDjpD1auOsQmem3Ymc6emr1XgWEWjk7Xk7ctBpbopwtJYGHAHOKpa9R34usN48hlo1Lyf8h_vJ13_mTq1SNFBUjYsqW6FgnhB0KCzv7J-HHPVJaC6ZSxxhcTraOR0oh/s72-c/financial+year+by+Country.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>