Re: taking off decimals
From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 11/03/04
- Next message: Aaron [SQL Server MVP]: "Re: trigger to affect only 1 row at a time"
- Previous message: Tom Moreau: "Re: Creating unique Index"
- In reply to: Ken: "taking off decimals"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 15:19:56 -0600
This sounds like the datatype in the grid is treating it as a generic
number, rather than as an integer. Since it shows up in Query Analyzer as
an integer, it is probably something you will have to do in the client.
One thing not yet checked, is the datatype of each of the FieldN values
integer, or are they numeric or real? If they are not integers, then cast
the whole thing as an integer, like:
select cast(sum(categoryId) + sum(categoryId) as int) as sumCategories
from northwind..categories
-- ---------------------------------------------------------------------------- Louis Davidson - drsql@hotmail.com SQL Server MVP Compass Technology Management - www.compass.net Pro SQL Server 2000 Database Design - http://www.apress.com/book/bookDisplay.html?bID=266 Note: Please reply to the newsgroups only unless you are interested in consulting services. All other replies may be ignored :) "Ken" <Ken@discussions.microsoft.com> wrote in message news:19A60486-1ECA-45B4-B82F-2C7DC0B8C839@microsoft.com... > I have a View with some calculated fields > > SUM(Field1) - SUM(Field2) - SUM(Field3) as Total > > When I see the result in the view it has no decimals eg. 9000 > > but when I retrive the value (via SQLDataReader bind to a DataGrid) it shows > the number with decimals eg. 9000.00000 and I donīt want decimals to be shown > > Is there a way to do it via the Data Base or it has to be done via My > Application? > > ken > > > >
- Next message: Aaron [SQL Server MVP]: "Re: trigger to affect only 1 row at a time"
- Previous message: Tom Moreau: "Re: Creating unique Index"
- In reply to: Ken: "taking off decimals"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|