[dba-SQLServer] nevermind (Fw: conversion mystery)

jwcolby jwcolby at colbyconsulting.com
Wed Jan 16 13:51:49 CST 2008


LOL, the OhNoSecond! 


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan
Harkins
Sent: Wednesday, January 16, 2008 2:11 PM
To: SQLList
Subject: [dba-SQLServer] nevermind (Fw: conversion mystery)

Nevermind, as soon as I sent the message, the light went on!

Susan H.

----- Original Message -----
From: "Susan Harkins" <ssharkins at gmail.com>
To: "SQLList" <dba-SQLServer at databaseadvisors.com>
Sent: Wednesday, January 16, 2008 1:22 PM
Subject: conversion mystery


> The following expression
>
> SickLeaveHours/8
>
> returns whole numbers because SickLeaveHours is an int column -- at least,

> I believe that's the reason.
>
> I've tried the following:
>
> CAST(SickLeaveHours/8 As decimal(6,4)) As SickHoursUsed
>
> but it still returns a whole value, just with four decimal places, all 
> sporting 0's. I've tried numeric, with the same results. I want this 
> expression to return valid decimal values -- for instance, 69/8 = 8.625. 
> I'm getting 8.0000
>
> Also, I'd really like to discuss this percision, scale business -- I don't

> get it at all. I don't understand how the two interact -- for instance, in

> the above decimal(5,4) returns an error, but 6,4 doesn't.
>
> Susan H. 

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list