SQLNewUser
SQLNewUser

Reputation: 11

SQL Server Reports Builder - Week Number from Today()

I am trying to create a calculated field in SQL Server Reports Builder of which the output is Week Number (e.g. 1, 12, 32, 45, etc...) and am using the following expression:

=DatePart("ww",Today())

I am getting a result of "99". What am I doing wrong?

Upvotes: 1

Views: 6592

Answers (2)

Ross Hetzel
Ross Hetzel

Reputation: 61

Roman Pelepei has a great Article on this.

This should do the trick.

=DatePart(DateInterval.WeekOfYear, Today())

You may have to use Now() instead of Today() but it will work all the same.

Upvotes: 6

Dave.Gugg
Dave.Gugg

Reputation: 6781

Try = DATEPART(WEEK,GETDATE())

Upvotes: 0

Related Questions