Using N/Query, I need to get the last customer inv...
# suitescript
e
Using N/Query, I need to get the last customer invoice date for every inventory item in a given location... Can anyone help me to figure out how to construct the query?
So far, i have this
SELECT
MAX(t.trandate) as trandate,
FROM transactionline tl
LEFT JOIN transaction t ON t.id = tl.transaction
WHERE recordtype = 'invoice' AND t.void= 'F' AND tl.location = 308
GROUP BY
tl.item,t.trandate
But it gives me duplicates... How can I get only the latest item/date ?
d
What is being duplicated? The items?