Cross Join in a BAQ

Hey all,

Does anyone know if it is possible to do a CROSS JOIN inside a BAQ? I’m attempting to create a placard where there would be a production quantity of 5 and make a query that shows 1 of 5, 2 of 5 etc… with 5 different pages.

I accomplished this in T-SQL but I am not sure how to translate it to BAQ. Example below. I’m not sure if there is an easier way to accomplish this.

SELECT JobNum, ProdQty, RowNum
FROM (
SELECT x.JobNum, x.ProdQty,
Row_Number() OVER (PARTITION BY x.JobNum ORDER BY x.JobNum) RowNum
FROM ERP.JobHead AS x
CROSS JOIN ERP.JobHead AS y
WHERE x.JobNum = @JobNum
) AS u
WHERE RowNum <= ProdQty
ORDER BY JobNum;

1 Like

Should be able to have both tables in the designer without a join.

image

2 Likes

Holy Cannoli! I didn’t realize you could do that!

Thanks