how can convert transactionLine.quantitybilled wh...
# suiteql
s
how can convert transactionLine.quantitybilled whic is giving me the case unit amount to the correct unit messure of the bill
Copy code
transactionLine.quantitybilled   transactionLine.units
c
@Sim Greenbaum you can join in the
unitstypeuom
table to access the
conversionrate
for the units on both transactions and convert between them.
s
so i would need to make a subquery
Copy code
SELECT
     transactionLine.transaction,
    transactionLine.uniquekey,
    transactionLine.memo,
    transactionLine.item as item_id,
    NVL(transactionLine.quantityshiprecv,0) a,
    transactionLine.quantitybilled,
    transactionLine.units,
    -- (add subquery)
    -- BUILTIN.DF(transactionLine.quantitybilled, transactionLine.units)
    FROM transactionLine
    INNER JOIN NextTransactionLineLink ON
      NextTransactionLineLink.previousline = transactionLine.id AND
      NextTransactionLineLink.previousdoc = transactionLine.transaction
      WHERE NextTransactionLineLink.nextdoc = 14121889
Copy code
SELECT uom.conversionrate 
FROM unitsType 
INNER JOIN unitsTypeUom as uom 
    ON (unitsType.id = uom.unitstype) 
WHERE uom.internalid = ???
if anyone wants to know the subquery i used see below
Copy code
(SELECT conversionrate FROM unitsTypeUom WHERE internalid = transactionLine.units) AS whatever