If you are getting the below error in Version 6.2.35:
SAVE THE ATTACHED SCRIPT TO YOUR DESKTOP
Log in as admin --> go to FILE-->MAINTAIN-->ADVANCED--> RUN DB COMMAND--> Browse to the saved file--> select file--> run.
Attachment: https://info.ordertime.com/hubfs/qrySOTotals.sql