Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 decimal return

Author  Topic 

skillile
Posting Yak Master

208 Posts

Posted - 2001-11-09 : 08:23:11
--I am trying to get a decimal return
--if i convert dec(5,2) it doesn't work
--any suggestions
--i want @ans to return x.xx

DECLARE @sdate smalldatetime
DECLARE @edate smalldatetime
DECLARE @inc int
DECLARE @ans int
SET @inc = 20
SET @sdate='11/4/2001 8:00:00:00'
SET @edate='11/4/2001 10:30:00:00'


SET @ans=datediff(mi, @sdate, @edate)/@inc
--how do i return this as a decimal


SELECT @ans


thanks

slow down to move faster...
   

- Advertisement -