November 10, 2009 at 2:09 pm
hi all,
how can i get the precision part from this
select cast(73982597/1000 as numeric(8,3))
thanks in advc
Thanks [/font]
November 10, 2009 at 2:21 pm
DECLARE @Num AS Numeric(8)
SET @Num = 73982597
select cast(@Num/1000 as Numeric(8,3))
This will also return what you seem to require
select cast(73982597./1000 as numeric(8,3))
In the code immediately above note the decimal point..
Returns: 73982.597
November 10, 2009 at 2:27 pm
SQL Learner-684602 (11/10/2009)
hi all,how can i get the precision part from this
select cast(73982597/1000 as numeric(8,3))
thanks in advc
This is basically the same question you asked here just worded slightly differently.
Same thing, integer arithmetic. This will give you what you are looking for as well:
select cast(73982597/1000.0 as numeric(8,3))
November 10, 2009 at 2:33 pm
Thank You Lynn :-):-):-)
Thank You bitbucket-25253 :-):-):-)
Thank You :-):-):-)
Thank You :-):-):-)
Thanks [/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply