Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL SELECT SYNTAX

Good day,

I have a simple question with probably a simple solution but I keep getting the following script and  error:

/QTQVC/OPEN_STREAM failed after 00:00:00 Key = SQL_ERROR (ID:00 Type:E Number:001 "," is invalid here (due to grammar). contains an invalid character or it is a keyword. (It might be possible to escape it using "!"). Or a space is missing or there is one space too many.)

SQL Select

LIFNR,

GJAHR,

MONAT,

BLART,

SUM(DMBTR) AS [AMOUNT]

FROM

BSAK

WHERE GJAHR = '2018' AND (BLART = 'RE' OR BLART = 'KR')

GROUP BY LIFNR, GJAHR, MONAT, BLART;

Please assist as I cannot find the problem

Kind regards

13 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Is GJAHR really a text field? Remove the quotes around the year value.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anil_Babu_Samineni

For funny solution may be here

in ('RE' , 'KR') // I make it as Space over IN operator

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

It seemed that removing all the commas and putting a space after and before the brackets in the WHERE clause ( BLART = 'RE' OR BLART = 'KR' ) did the trick, thank yo for all the help, I appreciate it.

Anil_Babu_Samineni

Is that trick make sense? Or still you are expecting some thing from community?

If you got answer as you expected, Better to close this thread by flag correct answer and helpful answers as you feel

Don't hesitate to ask while you get expected result.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful