Friday 9 June 2017

SSRS - Switch Statement

Problem: Display month (1,2,3 to January, February and March)

Right click on the expression, it will open popup and paste the below expression there.
In below expression, MonthNumber is the column name, if column value is 1 then change to January and so on with the help of switch statement.

=switch(
Fields!MonthNumber.Value=1,"January",
Fields!MonthNumber.Value=2,"February",
Fields!MonthNumber.Value=3,"March",
Fields!MonthNumber.Value=4,"April",
Fields!MonthNumber.Value=5,"May",
Fields!MonthNumber.Value=6,"June",
Fields!MonthNumber.Value=7,"July",
Fields!MonthNumber.Value=8,"August",
Fields!MonthNumber.Value=9,"September",
Fields!MonthNumber.Value=10,"October",
Fields!MonthNumber.Value=11,"November",
Fields!MonthNumber.Value=12,"December"
)



No comments:

Post a Comment

How to find the reason of HTTP Error 500.30 - ASP.NET Core app failed to start in Azure App Service

HTTP Error 500.30 - The ASP.NET Core app failed to start If your web app is throwing an error HTTP error 500.30 then how to find the root ca...