Skip to content

Convertir decimal a entero SQL SERVER

January 26, 2012

SELECT CAST((ROUND(campo1,0)) AS INT) AS campo1
FROM tabla

Con esta senzilla función aplicada a un campo con cifras decimales, podemos redondear a entero, para mostrar dicho valor por pantalla.

From → Datos, SQL Server

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: