![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm getting that on this stored procedure: it appears to be on this line: N'CAST((1.0 * icnt / NULLIF(tcnt, 0) * 100) AS decimal (6, 1)) AS perc What do I change it to so I can get rid of the error? |
#3
| |||
| |||
|
|
I'm getting that on this stored procedure: it appears to be on this line: N'CAST((1.0 * icnt / NULLIF(tcnt, 0) * 100) AS decimal (6, 1)) AS perc What do I change it to so I can get rid of the error? |
#4
| |||
| |||
|
|
JJ297 (nc... (AT) yahoo (DOT) com) writes: I'm getting that on this stored procedure: it appears to be on this line: * *N'CAST((1.0 * icnt / NULLIF(tcnt,0) * 100) AS decimal (6, 1)) AS perc What do I change it to so I can get rid of the error? Change decimal to float to see what values you get, and see if there is anything suspicious. When you the decimal data type, you should always specify precision and scale explicitly, and not rely on defaults. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
#5
| |||
| |||
|
|
Thanks I changed it to decimal(18,1) and that seemed to work. What do you mean by this... When you the decimal data type, you should always specify precision and scale explicitly, and not rely on defaults. |
|
* 100) AS decimal (6, 1)) AS perc |
#6
| |||
| |||
|
|
Thanks I changed it to decimal(18,1) and that seemed to work. *What do you mean by this... When you the decimal data type, you should always specify precision and scale explicitly, and not rely on defaults. You already do this with (18,1)! I think he did not read this in your first post because of *>> * 100) AS decimal *>> (6, *>> 1)) AS perc Lutz |
![]() |
| Thread Tools | |
| Display Modes | |
| |