Microsoft
Software
Hardware
Network
Question : SQL SERVER STORED PROCEDURES ROUNDING INTEGERS
Hi Guys,
I am having a little difficulty with rounding two integers. Below stored procedure is an example:
exec usp_Stats '99';
DROP PROCEDURE usp_Stats;
GO
CREATE PROCEDURE usp_Stats(@pastStatsDate int)
AS
UPDATE MYTABLE
SET MIN_QTY_INT = ROUND((65 / @pastStatsDate.0 * MYTABLE.CUSTFIELD),0),
From MYTABLE;
I am trying to round two integers. I am aware that if it was not a param variable name and just a number I could go something like...
ROUND((65 / 99.0 * MYTABLE.CUSTFIELD),0),
...and this would work fine. I am trying to do it with an integer parameter variable which is passed into the procedure, like in the first example. I cannot get it to work. Can anyone advise me on how to resolve this.
Thank you.
Answer : SQL SERVER STORED PROCEDURES ROUNDING INTEGERS
try making (@pastStatsDate a decimal
Random Solutions
insert query in code behind asp.net
How do I remove these borders?
Word 2007 can't open word 2003 .doc files
Cut / paste rows based on criteria in one column into different worksheet; repeat multiple times
Dragging ReportViewer in VS2005 generates a 'protected memory' and an 'Invalid FORMATETC' error.
Putting functions in a VBA Macro in Excel or indenting as a macro.
exchange 2007 sending emails
Sharing workbook lock for editing
Quick Launch Toolbar Office 2k7 - Roaming Profiles
Exchage Error SPAM question.