Reputation: 1221
I have the following MSSQL query to return the ending day of the week in MSSQL:
SELECT DateAdd(Day, 0 - DatePart(Weekday, GetDate()), GetDate());
I played around with the =DateAdd
function, but it keeps throwing me an error for the Day parameter. Also, when I used DateInterval.Day
... I get the same error.
However, when I try placing that query into an SSRS expression, it throws me an error. Does anyone know the direct conversion for that query above in SSRS?
Upvotes: 3
Views: 6982
Reputation: 39777
SSRS Uses a dialect of Visual Basic, its Date functions are different from TSQL, you have to use
Try
=DateAdd("d", 0 - DatePart("w", Now()), Now())
Upvotes: 4