Daniel L. VanDenBosch
Daniel L. VanDenBosch

Reputation: 2734

How do I find the current quarter in SSRS?

How would I find the Current Quarter in SSRS? I am trying to set a default value for a parameter to the current quarter. I tried:

=QUARTER(NOW)

But it returned the following error:

The Value expression for the report parameter ‘pquarter’ contains an error: [BC30451] 'QUARTER' is not declared. It may be inaccessible due to its protection level.

As of the writing of this post 6/20/2018 I am trying to return 2.

Upvotes: 0

Views: 5222

Answers (3)

xcvbn13
xcvbn13

Reputation: 46

In SSRS:

DatePart(DateInterval.Quarter,Fields!date_var.Value)

Upvotes: 2

Daniel L. VanDenBosch
Daniel L. VanDenBosch

Reputation: 2734

I was able to find the following function:

=DatePart("q",NOW())

It seems to work.

Upvotes: 0

JonTout
JonTout

Reputation: 640

Quater is a date related and this should work.

select DATEPART(Q,GETDATE())

Upvotes: 0

Related Questions