Thank you, that works with a little modification because my articlestock table also contains artNo records where the inventory is 0.select COUNT(a.artNo) as totalcnt, COUNT(b.artNo) as instockcntfrom articles aleft join (select artNo from atriclestock where inStock > 0) b on a.artNo = b.artNowhere a.artStatus = 1
When I'm trying to divide my article count by my articlestock count I get a value of 0, but I would expect a value of 0.XX.Can I not divide one count by another?select COUNT(a.artNo) as totalcnt, COUNT(b.artNo) as instockcnt, COUNT(b.artNo)/ COUNT(a.artNo) as ratiofrom articles aleft join (select artNo from atriclestock where inStock > 0) b on a.artNo = b.artNowhere a.artStatus = 1