web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Display current week of they year in SSRS report, DatePart function overload error

(0) ShareShare
ReportReport
Posted on by 1,078

Hi Community,

On a SSRS report called from AX, I need to display current week of the year. I am using Datepart("ww",today()), it works fine but by default it takes 1st January to calculate number of weeks. I need to calculate no. of weeks by taking Monday as first day of the week. 

I changed the expression to Datepart("ww",today(),2,0), but when I build and deploy the report I get the below error

Error 2 System.Web.Services.Protocols.SoapException: The Value expression for the textrun ‘textbox39.Paragraphs[0].TextRuns[0]’ contains an error: [BC30519] Overload resolution failed because no accessible 'DatePart' can be called without a narrowing conversion:
at Microsoft.ReportingServices.Library.ReportingService2005Impl.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Guid batchId, Warning[]& Warnings)
at Microsoft.ReportingServices.WebServer.ReportingService2005.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings) C:\Program Files (x86)\MSBuild\Microsoft\DynamicsTools\Microsoft.Dynamics.Framework.Design.Reporting.Modeling.targets 466 6 ReportModel
I think it may be due second parameter being date instead of datetime, but I don't know how to give datetime. Also I am not sure if this is the problem. Please help me resolve this.
Thanks
Guru
I have the same question (0)
  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Guruprasanna M,

    Do you test it in devbox or in sandbox?

    Could you, please, also check if using FirstDayOfWeek and FirstWeekOfYear instead of int const works?

    =DatePart("ww", today(), FirstDayOfWeek.Monday, FirstWeekOfYear.System)

  • Guruprasanna Profile Picture
    1,078 on at

    Hi Sergei,

    Thank you for your response, our team has decided to solve this with custom function.

    Regards

    Guru

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans