BAQ Assistance

,

I have an interesting issue on my hands. I have made a cross-company baq that totals pay hours vs labor hours by employee for the current month. I am currently using data for March. I am wanting to calculate employee utilization by dividing total labor hours by total pay hours and multiply by 100 to get our percentage. The issue I’m facing is that there are null values within labor hours because we have indirect workers. I fixed that by using isnull(sum(laborhours),0) and can then use the 0 in the calculation.

New problem, if I divide the labor hours by pay hours I get a bad SQL statement which breaks my baq, but not completely. It still shows results for the company I am currently working in with no errors highlighted in yellow. Has anyone else ran into this before? Why does it still produce some results but not all? If I remove pay hours and substitute in something like 200 the BAQ runs without issue or error.

Thanks for the help!

One of the line items is dividing by zero. Epicor reports a generic “Bad SQL statement”, but you should be able to see a more specific error if you look on the AppServer’s Event Viewer.

Edit: It looks like you’re hosted by Epicor, so I’m not sure if there’s a way to see the specific error that you have access to.

are you getting a divide by zero error? Trying doing:
iif(payHours = 0,0,laborHours/PayHours*100)

1 Like

@timshuwy good sir you just knocked that one out of the park! That did the trick! Thank you very much!
@tsmith It was indeed a divide by zero as you said as for the app server event viewer we do not have that available to us unfortunately. Thanks for the help all the same!