|
Archives of the TeradataForumMessage Posted: Fri, 16 May 2014 @ 13:02:31 GMT
Hi, Yes, ROUND is implemented as a udf and is standard on TD 14.0 + systems. If you haven't got that or do not use it (for whatever reason) then you're looking at the two 'older' ways of rounding in Teradata. 1) In DBSControl there is a setting called RoundHalfWayMagUp, defaults to FALSE. If set to TRUE then rounding follows what is often known as 'bankers rounding'. This should achieve what you want. However, that applies system-wide. 2) At the individual SQL request level do it the 'really old' way: SELECT CAST((15.37 + .5) AS INTEGER) AS d1, CAST((15.67 + .5) AS INTEGER) AS d2; This example rounds the first to 15 and the second to 16. I think that is what you want. Cheers, Dave Ward Analytics Ltd - Information in motion (www.ward-analytics.com)
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||