CD - Calculated Decision in workflows where we have limited application licenses

Hei,

We want to create a workflow step using CD - Calculated Decision where we want to stop the approval process before numbers of application licences is exceeded.

So if we f.ex. have 100 licenses we need the calculated decision to avoid the approval of no.101.

We have tested a number of SQL Queries to simulate this, but with no success.

Any advise is highly appreciated!

Thanks!

Maybe there are another ways to deal with limited licenses in the approval process?

Regards

Stig Hylen