Is it because of divisibility? ! Divided by two integers, the result is an integer, so when the numerator is less than the denominator, both return 0 as the result.
Try what the following statement returns:
Select the sum (number of hits), sum (number of swings), sum (number of hits)/sum (number of swings) hit rate.