To calculate the weekday name in RDLC you can use a combination of two Visual Basic functions:
-
DatePart
SyntaxDatePart(interval,date[,firstdayofweek[,firstweekofyear]])
firstdayofweek is an Optional parameter and the Default value is 1 (Sunday).
firstweekofyear is an Optional parameter and the Default value is 1 (January). -
WeekdayName
SyntaxWeekdayName(weekday[,abbreviate[,firstdayofweek]])
abbreviate is an Optional parameter. A Boolean value that indicates if the weekday name is to be abbreviated.
firstdayofweek is an Optional parameter and the Default value is 1 (Sunday).
HOW TO calculate the weekday name in RDLC
CORRECT RESULTS
[sourcecode language=”VB”]
=WeekDayName(DatePart("w", Fields!CurrentDate_System.value,0))
=WeekDayName(DatePart("w", Fields!CurrentDate_System.value,0,0))
[/sourcecode]
WRONG RESULTS
[sourcecode language=”VB”]
=WeekdayName(DatePart("w", Fields!CurrentDate_System.Value))
=WeekdayName(DatePart("w", Fields!CurrentDate_System.Value),false,0)
[/sourcecode]
Did my HOW TO help you? Leave a reply.