Nelson Viggiani-332216
Ten Centuries
Points: 1264
More actions
July 21, 2006 at 6:54 am
#114304
I need to divide 6 days by 30 days: on the calculator 6/30 = 0.2
select 6/30 = 0
How do I fix this??
thanks
SQLZ
SSChampion
Points: 12872
July 21, 2006 at 7:49 am
#650692
Hi,
you need to use decimals otherwise SQL Server will assume you're trying to divide integers.
Try this:
select 6.0/30.0
Karlsource control for SQL Server
July 21, 2006 at 9:15 am
#650744
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply