I am using SQL Server 2012.
I have the following operation:
select 1/12
Why does it result in zero?
I expect 0.08333333
Regards.
I am using SQL Server 2012.
I have the following operation:
select 1/12
Why does it result in zero?
I expect 0.08333333
Regards.
You're implicitly asking for an integer result, because both "1" and "12" are integers. All you have to do is to change one (or both) of them to a decimal to get what you want.
SELECT 1.0/12