BAQ return only 1 row per part number

You would recreate this SQL using the BAQ editor. It can be challenging if you don’t know SQL. But you can compare what shows up on the general tab for the BAQ this to see if you are on the right track. The one Ken Posted is a little advanced.

These are the fields you grab from part tran table in field selection, except for RowNum. That’s a calculated field.

Select a.PartNum, a.TranType, a.TranDate, a.TranQty, b._RowNum

This is what you put in the calculated field go get your row numbers.

ROW_NUMBER() OVER (PARTITION BY partnum ORDER BY  SysRevID DESC ) 

This created by putting a criteria in your subquery criteria tab under the table canvas.

Where 1 =1 and b._RowNum = 1

If that don’t know what the 1=1 is for. @knash can you fill us in on that part?

1 Like