cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA query to return Invoices that do not have UDF Advice filled in after 30 days

former_member268870
Participant
0 Kudos

Experts,

I have a customer who wants a query to show only Invoices that after 30 days of posting do not have a UDF filled in. This is on SAP HANA could and I started this query with the generator, which added the ".

The red part is which gives me errors, without that the query is correct.

SELECT T0."DocNum", T0."DocDate", T0."CardName", T0."U_L", T0."U_ACC_02", T0."U_ACC", T0."U_ACC_01", T0."PaidToDate", T0."DocTotal" FROM OINV T0

WHERE T0."DocDate" >= dateadd(day,datediff(day,30,GETDATE()),0)

AND T0."DocDate" < dateadd(day,datediff(day,0,GETDATE()),0)

AND T0."U_ACC_01" IS NULL

Your help would be appreciated,

Marli

Accepted Solutions (1)

Accepted Solutions (1)

former_member268870
Participant
0 Kudos

This solved the issue:

SELECT T0."DocNum", T0."CardName", T0."DocDate", T1."PymntGroup", T0."DocTotal", T0."U_ACC_01", add_days(T0."DocDate",30) as "Calculated Date"

FROM OINV T0  INNER JOIN OCTG T1 ON T0."GroupNum" = T1."GroupNum"

WHERE T0."DocStatus" = 'O' AND curdate() >=  add_days(T0."DocDate",30)

AND (T0."U_ACC_01" = '' or T0."U_NBS_ACC_01" is NULL)

Answers (0)