Hello everyone,
If I want to run few lines of select query in X++, but the table that I'm using is the same table. For illustration is something like this :
1. Run /select sum(salesamount) from salesline join salestable where salesline.salesid == salestable.salesid and salestable.salesstatus == open order/
2. Run /select sum(salesamount) from salesline join salestable where salesline.salesid == salestable.salesid and salestable.salesstatus == delivered/
3. Run /select sum(salesamount) from salesline join salestable where salesline.salesid == salestable.salesid and salestable.salesstatus == invoiced/
At each step, I saved the amount result to my custom table's record. Do I need to declare 3 variables salesline and 3 variables salestable ? or 1 variable each table is enough ?
Btw, those 3 will be inside a while statement, which the /where clause/ actually needed to add some more from that where loop.
Thanks.