Reputation: 89
I am trying to set a simple expression in SSRS in my report using the datepart function:
=datepart("dw",Fields!period_dt.Value)
When I preview the report, the values come up as #error.
Am I missing something completely obvious here?
The Fields!period_dt.Value field contains dates in this format 12/31/2013 12:00:00
Upvotes: 0
Views: 1034
Reputation: 39566
In your expression:
=datepart("dw",Fields!period_dt.Value)
dw
is not a valid datepart.
Assuming you want the day of the week, use:
=datepart("w",Fields!period_dt.Value)
or
=datepart(DateInterval.Weekday,Fields!period_dt.Value)
Which both return 3
for 12/31/2013 12:00:00
.
See DatePart Function for more details on this.
Upvotes: 0