check out this example, it will do exactly what you are looking for in a BAQ. If you import the BAQ you should be able to look at the SQL, (that’s where I stop being helpful, as I don’t know SQL and I just use BAQ’s for pretty much everything)
1 Like