cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Query to Exclude Cancelled Journal Entry

0 Kudos

I'm creating a report and I don't want the canceled journal entries to appear. I have this query below but it is working in SQL can anyone help me to convert it into HANA?

SELECT T0.TransId FROM OJDT T0 WHERE (T0.TransId not IN (SELECT T0.StornoToTr FROM OJDT T0 where t0.stornototr is not NULL)) AND (t0.stornototr is NULL)
pressaobr1
Explorer
0 Kudos

Boa noite omarsalama!

Segue a consulta convertida para Hana.

SELECT T0."TransId" FROM OJDT T0 WHERE (T0."TransId" NOT IN (SELECT T0."StornoToTr" FROM OJDT T0 WHERE t0."StornoToTr" IS NOT NULL)) AND (t0."StornoToTr" IS NULL);

Accepted Solutions (0)

Answers (2)

Answers (2)

hdolenec
Contributor

IFNULL/ISNULL difference only neccessary if converting NULL field to some value, for example IFNULL(Field, ''). When making a WHERE clause that a certain field has to be NULL value to show result then correct syntax is "Field IS NULL". The below query should do the trick:

SELECT T0."TransId" FROM OJDT T0 WHERE (T0."TransId" NOT IN (SELECT T0."StornoToTr" FROM OJDT T0 WHERE T0."StornoToTr" IS NOT NULL)) AND (T0."StornoToTr" IS NULL)
kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Also change IS NULL to IF NULL for HANA query.

Regards,

Nagarajan