cancel
Showing results for 
Search instead for 
Did you mean: 

Help with a query - SAP B1 HANA

hel-diegops
Discoverer
0 Kudos
602

Hello!

I'm trying to edit a query to get a variable condition, but, dont matter what i try, i always get:


"1). [SAP AG][LIBODBCHDB32 DLL][HDBODBC32] Syntax error or access violation;257 sql syntax error: incorrect syntax near "T0": line 8 col 6 '' (SWEI) (at pos 160)"

Original query (No error):

SELECT
T0."DocNum", T0."U_UPItmCod", T0."U_UPItmNam", T0."U_UPQtdPla", T0."U_UPDatFch", T0."U_UPWhsCod"

FROM
"SBO_HELSTEN_PROD"."@UPR_OWOR" T0

WHERE
T0."U_UPOPSbTy" = 'R'

"New" query:

SELECT
T0."DocNum", T0."U_UPItmCod", T0."U_UPItmNam", T0."U_UPQtdPla", T0."U_UPDatFch", T0."U_UPWhsCod"

FROM
"SBO_HELSTEN_PROD"."@UPR_OWOR" T0

WHERE
T0."U_UPOPSbTy" = 'R'
and T0."U_UPDatLan" =[%0]

How can i make that last sintax work?

Thanks!

PS: SAP B1 running on Hana, 9.2.
Field "U_UPDatLan" is "Date" type.

Accepted Solutions (0)

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this,

SELECT
T0."DocNum", T0."U_UPItmCod", T0."U_UPItmNam", T0."U_UPQtdPla", T0."U_UPDatFch", T0."U_UPWhsCod"

FROM
"SBO_HELSTEN_PROD"."@UPR_OWOR" T0

WHERE
T0."U_UPOPSbTy" = 'R'
and T0."U_UPDatLan" = '[%0]'

Regards,

Nagarajan

hel-diegops
Discoverer

Hello Nagarajan,

Thanks for the answer!
I tried that query, but i receive "(SWEI) error.

Thank you.