This is the SQL statement:
select dbo.tblWorkflow.WorkflowName, IsNull ( (Select the sum (dbo.tblSchemaOperation_Execution.ExecutedQuantity * dbo.tblOperationItemPrice.UnitPrice) as the amount dbo.tblSchemaOperation_Execution Join from within dbo.tblOperationItemPrice dbo.tblSchemaOperation_Execution.OperationID = dbo.tblOperationItemPrice.OperationID Group by dbo.tblSchemaOperation_Execution. SchemaYear, dbo.tblSchemaOperation_Execution.SchemaNO (dbo.tblSchemaOperation_Execution.SchemaNO = dbo.tblWorkflowActivtyInsatnce.SchemaNO) and (dbo.tblSchemaOperation_Execution.SchemaYear = dbo.tblWorkflowActivtyInsatnce.SchemaYear)), 0) dbo.tblWorkflowActivtyInsatnce Inside as ActualAmount Dbo.tblWorkflowActivtyInsatnce.WorkflowID = dbo.tblWorkflow.WorkflowID on interactive dbo.tblWorkflowActivtyInsatnce.WorkflowActivityID = dbo.tblWorkflowActivity.WorkflowActivityID where dbo.tblWorkflowActivity JOIN (dbo.tblWorkf lowActivtyInsatnce.StartDate is not zero) and (dbo. TblWorkflowActivtyInsatnce.FinishDate IS NULL) and (dbo.tblWorkflowActivity.ActivityName & lt; & Gt; 'Execution') and output is:
How can I use the amount for the overall service? This way Workflow: The actual amount ------------: ------------ Sacko: 28020.00 Severag: 6105.00
After
This is what you want, using by group And yoga ?
Select WorkflowName, from SUM (ActualAmount) (select dbo.tblWorkflow.WorkflowName, Select IsNull ((Select Yoga (dbo.tblSchemaOperation_Execution.ExecutedQuantity * dbo.tblOperationItemPrice.UnitPrice) join dbo.tblSchemaOperation_Execution.SchemaYear by dbo.tblOperationItemPrice.OperationID = dbo.tblSchemaOperation_Execution.OperationID Group amount within dbo.tblSchemaOperation_Execution which dbo.tblOperationItemPrice, dbo.tblSchemaOperation_Execution.SchemaNO be (dbo.tblSchemaOperation_Execution.SchemaNO = dbo.tblWorkflowActivtyInsatnce.SchemaNO ) And (dbo.tblSchemaOperation_Execution.SchemaYear = dbo.tblWorkflowActivtyInsatnce.SchemaYear)), 0) as dbo.tblWorkflowActivtyInsatnce Join ActualAmount from within dbo.tblWorkf dbo.tblWorkflow.WorkflowID = dbo.t blWorkflowActivtyInsatnce.WorkflowID insider fewer Where dbo.tblWorkflowActivity.WorkflowActivityID = dbo.tblWorkflowActivtyInsatnce.WorkflowActivityID dbo.tblWorkflowActivity (dbo.tblWorkflowActivtyInsatnce.StartDate IS NOT NULL) and (dbo.tblWorkflowActivtyInsatnce.FinishDate zero) and (dbo.tblWorkflowActivity.ActivityName & Lt; & Gt; 'Execution')) ASX Group by Deobo. Block Workflow Verlflame
Comments
Post a Comment