Its a job, x++ job. Create a new job in AOT and paste the code there.
Then read the code and change query name from CustTable to your needed query name such as smmSalesCustItemStatistics
Its a job, x++ job. Create a new job in AOT and paste the code there.
Then read the code and change query name from CustTable to your needed query name such as smmSalesCustItemStatistics