How to use the TRUNC function on SQL Server 2012, since getting TRUNC is not a recognized built-in function name. '?

How to use the TRUNC function in SQL Server 2012, since I get an error:

'TRUNC' is not a recognized built-in function name. ''

when i execute the statement

 SELECT TRUNC(30.95, 1) 

in SQL Server 2012

http://msdn.microsoft.com/en-us/library/ee634907.aspx

+4
source share
2 answers

This is a DAX function, not a built-in SQL function. It looks like they will be used in Excel.

http://technet.microsoft.com/en-us/library/gg399181.aspx

The built-in function for SQL Server 2012 is here:

http://msdn.microsoft.com/en-us/library/ms177516.aspx

+7
source
 ROUND ( 30.95 , 1 , 1 ) 

When the third parameter ! = 0 , it cuts, not rounds

http://msdn.microsoft.com/en-us/library/ms175003(SQL.90).aspx

Thanks to fooobar.com/questions/40826 / ...

+3
source

Source: https://habr.com/ru/post/1487946/


All Articles