August 8, 2017 at 8:06 am
Hi ,
I am using following Query out. But I dont know what is difference .Please explain me.
select convert(money,convert(float,64.98695))
Output : 64.9869
select convert(money,convert(float,63.98695))
Output : 63.987
What is a difference?
August 8, 2017 at 8:29 am
vs.satheesh - Tuesday, August 8, 2017 8:06 AMHi ,I am using following Query out. But I dont know what is difference .Please explain me.
select convert(money,convert(float,64.98695))
Output : 64.9869
select convert(money,convert(float,63.98695))
Output : 63.987What is a difference?
From BOL:
The money and smallmoney data types are accurate to a ten-thousandth of the monetary units that they represent.
Your examples go down to hundred-thousandth accuracy.
Rewriting the queries as followsselect convert(money,convert(float,64.9869))
--Output : 64.9869
select convert(money,convert(float,63.9869))
--Output : 63.9869
Removes the inaccuracy.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply