December 26, 2006 at 3:55 am
hi to every one.
i am facing a problem in my sql query. first i let you know about the question.
there is a field Rate Numeric(18,4) and in this numeric field i insert 2.5, 10, 20, 2.05, 9.63, 65.9863 etc.
when i use select query it give me the following output.
2.5000, 10.0000, 20.0000, 2.0500, 9.6300, 69.9863 etc.
but i want output in the following ways.
2.5, 10 , 20, 2.05, 9.63, 65.9863 etc.
as i insert the data in this field i want the same output ..
which query should i apply for the same problem.
i tried this by using case when then , but i am not get the exact result.
if any one can resolve this problem then suggest query for that.
December 26, 2006 at 9:23 am
Sql server stores the data exactly as it should. 18 numerics, 4 of them decimals. It also sends out the data in that format as it should also. From there on out it's the presentation layer that must format the data and present it "correctly".
December 26, 2006 at 9:42 am
You can use the ROUND function to change things in a query or even convert to a char and then use SUBSTRING, but ninja is right. Do this in the presentation layer (web page, client app, etc)
December 26, 2006 at 2:47 pm
Do you need numbers or strings?
If values 12 and 12.0 are different for you and must be stored and returned differently?
_____________
Code for TallyGenerator
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply