This is what I wrote. Some [Item] are named "Misc. Adjustment (Miscellaneous Adjustments)", "Misc. Adjustment (Miscellaneous Adjustments)", and "P:Tools:Salon:MANN1092 (Practice Mannequin 14")"
I am trying to delete the additional information in the parenthesis.
With
TempSalesOrder as
(SELECT
CASE WHEN CHARINDEX('(',[item]) > 0
THEN TRIM(LEFT([item],CHARINDEX('(',[item])-1))
ELSE Trim([Item])
END as 'Trimmed_Name',
SUM(QTY) as 'Total_Sum'
FROM temp.QB_SO
GROUP BY [item], TRIM(LEFT([item],CHARINDEX('(',[item])-1)))