Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Filter within a Description

$
0
0

SELECT [Branch], SUM(qty) as TotalQty
FROM (
SELECT  
LEFT([Desc] + ' ',charindex(' ', [Desc], 1)) AS [Branch], [DESC], qty
FROM ARD1
     WHERE DATE BETWEEN '2013-12-01' AND '2013-12-31' ) AS X

GROUP BY [Branch]
ORDER BY [Branch]

I have here a query that is giving me the results I need the only problem there is, is that I may need to search for this branch anywhere in the description not just in the beginning is there a way to do that?


Debra has a question


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>