Hi, I’ve been asked to write a query that is basically “Show $ amount of all Open Purchase orders under $10”. The query is fairly simple, but I’m running into the problem of I cant add a range onto the SUM of purchLine.LineAmount so I only show records under $10.
Does anyone have a suggestion? Oh and this is for a Cue so it has to be a Query.
query query = new query();
queryBuildDataSource qbds_purchTable, qbds_purchLine;
qbds_purchLine = query.addDataSource(tableNum(purchline));
qbds_purchTable = qbds_purchLine.addDataSource(tableNum(purchTable));
// qbds_purchLine.addRange(fieldNum(purchLine,lineAmount)).value("<10"); //This adds the range at the line level not the aggregate value
qr = new queryRun(query);
purchLine = qr.get(tableNum(purchLine));
info(StrFmt("%1 %2",purchLine.PurchId, purchLine.LineAmount));