Friday, November 23, 2007

TSQL Tips 1 - Integer Arithmetic to return Float

This will get you "0" intead of "0.01" which you might expect.

SELECT 1/100


This will do the trick:

SELECT 1/cast(100 as float)


regards,
choongseng

1 comment:

Chris said...

AWESOME! Thanks!