Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding In Query Analyzer... 1

Status
Not open for further replies.

flaniganmj

Technical User
Jun 25, 2002
81
US
If a SQL Server 2000 table looks like this:

PK Value
-- ------
1 3.6456

where PK=int and Value=decimal(15,4)


Why would...
Code:
 select
   Value Value0, 
   Convert(varchar(20),Value) Value1
 from
   table
 where
   PK=1
...return the following in Query Analyzer...
[tt]
Value0 Value1
------ ------
3.65 3.6456
[/tt]

And...
Code:
 declare @p decimal(15,4)

 select 
   @p=Value 
 from 
   table 
 where 
   Value=1

 print @p

...will print
[tt]
3.6456
[/tt]

Additionally, when using the value in a calc it is rounding first???

Regards,

mjf



 
In QA, go to Tools -> Options -> Connections tab and uncheck "Use regional settings..." option.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top