November 10, 2003 at 8:28 am
I Delared two variables as
DECLARE @x DECIMAL(5,2)
DECLARE @y INT
SET @x = 1
SET @x = @x / 8
SET @y = @x * 5
Here i will get 0 but i need to return 1(even if it is .3 need to return 1), any ideas please.
Thanks.
November 10, 2003 at 8:33 am
USE CEILING... see the modified code
DECLARE @x DECIMAL(5,2)
DECLARE @y INT
SET @x = 1
SET @x = @x / 8
SET @y = ceiling(@x * 5)
select @y
Linto
November 10, 2003 at 8:35 am
what about
DECLARE @x DECIMAL(5,2)
DECLARE @y INT
SET @x = 1
SET @x = @x / 8
SET @y = CEILING(@x * 5)
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 10, 2003 at 8:37 am
hm...teaches me to post first and then talk
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 10, 2003 at 8:55 am
Thanks Linto,
It worked.
November 10, 2003 at 9:38 am
u r welcome...
Frank, u may need a fast connection! I posted that 3 minutes before you caught that..
November 11, 2003 at 12:47 am
Don't worry about the connection speed. I don't know what we have, but DSL seems slow compared to.
Anyway, srgangu has a solution and that's good!
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply