Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS - weekday name

any advice appreciated

I have as a column heading the expression =WeekdayName(weekday(fields!date.value))

This returns the day of the week, however, it is returning a day of the week one day in advance, eg when I put Monday's dates in the parameter it shows as 'Tuesday' in the report.

My question is can the above expression be tweaked to show the WeekdayName one day before, eg =WeekdayName(weekday(fields!date.value -1)) ? I tried this but got an error.

Thanks.

like image 297
Will F Avatar asked Dec 04 '14 08:12

Will F


2 Answers

So you want to subtract one day from the your incoming date then you can use the

  = DateAdd("d", -1, yourdateField)

This way you can subtract the any number of days from your date.

But did you try to see why it is giving the day of previous date. Do check the system date time or else check with the

 =WeekdayName(weekday(Today())) 

and see if it gives you the correct day of week for current date.

like image 194
Mahesh Avatar answered Nov 15 '22 13:11

Mahesh


Weekday and weekdayname functions have both another optional argument for defining the starting day of the week. Problem is the 2 functions don' t default this argument to the same value so depending on your server settings you should explicitly set the second argument of these functions.

like image 4
Stefano Avatar answered Nov 15 '22 14:11

Stefano