Here are some scripts which I use now and then, it is quite useful to have these handy.
--- percentage Calculation returns zero
select (43/50) * 100
---percentage calculation where you cast the values
select cast(43 as float)/cast(50 as float)*100
---percentage calculation
---with 2 decimal places
select convert(decimal(10,2),cast(43 as float)/cast(50 as float)*100)
---Date Scripts
select datepart(d,getdate()) --returns day number
select datepart(dw,getdate()) --returns day of week, day 1 = Sunday and 7 = Saturday
select datename(month,GETDATE()) --retunrs Month Name
select left(datename(month,GETDATE()),3) --returns first 3 letters of Month Name
select datename(WEEKDAY,GETDATE()) --returns Day Name
select left(datename(WEEKDAY,GETDATE()),3) --returns first 3 letters of Day Name
This blog contains tips and tricks for reporting services 2005/2008R2/2016 "This blog is provided 'AS IS' with no warranties, and confers no rights."
Thursday, 29 September 2011
Subscribe to:
Post Comments (Atom)
Keep SSRS (SSRS2016) report manager awake
When running a report for the first time in report manager it takes a while to run, after this initial run reports run fine. There are a ...
-
Due to the fact the reporting services allows you to query the tables you can easily write SQL which will allow you to return data from the ...
-
I have recently been looking at conditional page breaks in SSRS 2008 r2 and did not know that it is possible to do via an expression. For...
-
To add alternate colors in a matrix the expression should be as follows for the row group: =IIf( RunningValue (Fields!FIELDNAME.Value, Co...
No comments:
Post a Comment