any ideas why this is producing an error? Trying t...
# suiteql
j
any ideas why this is producing an error? Trying to incorporate in a M/R script.
Copy code
SELECT 
    c.id AS customer_id,
    NVL(SUM(tl.amount), 0) AS total_revenue
FROM 
    customer c
    LEFT JOIN transaction t ON t.entity = c.id
    LEFT JOIN transactionline tl ON t.id = tl.transaction
WHERE 
    c.isinactive = 'F'
    AND t.trantype = 'CustInvc'
    AND t.trandate BETWEEN TO_DATE('05/19/2025', 'MM/DD/YYYY') AND TO_DATE('08/19/2025', 'MM/DD/YYYY')
    AND t.status IN ('CustInvc:A', 'CustInvc:B')
    AND tl.account NOT IN ('41000', '43050')
    AND (tl.amount IS NOT NULL AND tl.amount != 0)
GROUP BY 
    c.id
e
On the first error, it's probably supposed to be "foreignamount" instead of "amount".
👍 1
b
transaction.type for the second one