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

Announcements

No record found.

News and Announcements icon
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:
I have the same question (0)
  • Suggested answer
    HACKDBA Profile Picture
    165 on at

    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.

  • Richard Wheeler Profile Picture
    75,852 Moderator on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans