Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

SQL Error trying to run an SSRS report

(0) ShareShare
ReportReport
Posted on by 30

Good morning,

Trying to convert a Crystal report to SSRS and I am trying to add a sales person ID parameter and getting the following error:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '+'.

This is my query:

"SALES ID: " + {?SalespersonID} + "        " + (if {?SalespersonID} ="All" then " " else {Command.SLPRSNFN} + " " + {Command.SPRSNSLN})

This is the query that I took from the Crystal report. Forgive me if this is a dumb question but I am fairly new to writing intricate reports in SSRS.

Thanks,

Victor

Categories:
  • Richard Wheeler Profile Picture
    75,848 Moderator on at
    RE: SQL Error trying to run an SSRS report

    Jonathan is absolutely correct. You will need to extract all queries out of Crystal Report and get them to run using SSMS. Hopefully you have someone there who can help you with that conversion.

  • Suggested answer
    HACKDBA Profile Picture
    165 on at
    RE: SQL Error trying to run an SSRS report

    Victor,

    The reason for your error is that it's not actually a SQL query. SSRS objects utilize T-SQL to retrieve data from the Dynamics GP database. If you are not familiar with T-SQL there are tons of resources on YouTube and Google to help get you going in the right direction. If you have access to a Pluralsight account there are tons of amazing courses on learning T-SQL in general.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 565

#2
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 402 Super User 2025 Season 1

Product updates

Dynamics 365 release plans