Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal returning as Integer
Message
 
 
À
13/10/2010 09:19:41
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01485249
Message ID:
01485253
Vues:
28
Frank,

Are you testing this SP in SSMS or from .NET application? Also, try specifying the output to be bigger, e.g. 30,2 for now.



>Numeric(18,2)
>
>>What is the type/definition for AmountReceived column?
>>
>>>
>>>I have this stored procedure:
>>>
>>>
ALTER PROCEDURE [dbo].[PoliciesGetSuspenseAmount]
>>>(
>>>	@PolicyHeaderPK uniqueidentifier,
>>>	@SuspenseAmount decimal(18,2) OUTPUT
>>>)
>>>AS
>>>	SET NOCOUNT ON;
>>>	SELECT 
>>>		@SuspenseAmount = COALESCE(SUM(AmountReceived), 0.00)
>>>	FROM [dbo].[ReceiptDetails]
>>>	inner join [dbo].[Receipts] on ReceiptFK = ReceiptPK
>>>	WHERE 
>>>		([PolicyHeaderFK] = @PolicyHeaderPK
>>>		AND ReceiptTypeFK = 4)
>>>
>>>However, when I execute it it rounds my decimals to an integer. If the result should be 69.57 I get back 70.
>>>
>>>What have I done wrong?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform