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, ...
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,848 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

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 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans