Answers for "cast int to float sql"

SQL
13

sql cast

-- Specifically for Oracle

-- EXAMPLE
CAST('732.98' AS INT)

/* SYNTAX
CAST(<value_to_cast> AS <data_type_to_cast_to>)
*/
Posted by: Guest on May-05-2020
0

convert float to int sql

Better to use CAST INT/CEILING/FLOOR:

SELECT CEILING(1235.53)
SELECT FLOOR(1235.53)
SELECT CAST(1235.53 AS INT)
Posted by: Guest on March-03-2021
0

sql cast to float

SELECT CAST(25.65 AS int);
Posted by: Guest on August-17-2021
0

sql cast date

DECLARE @counter INT = 0
DECLARE @date DATETIME = '2006-12-30 00:38:54.840'

CREATE TABLE #dateFormats (dateFormatOption int, dateOutput nvarchar(40))

WHILE (@counter <= 150 )
BEGIN
   BEGIN TRY
      INSERT INTO #dateFormats
      SELECT CONVERT(nvarchar, @counter), CONVERT(nvarchar,@date, @counter) 
      SET @counter = @counter + 1
   END TRY
   BEGIN CATCH;
      SET @counter = @counter + 1
      IF @counter >= 150
      BEGIN
         BREAK
      END
   END CATCH
END

SELECT * FROM #dateFormats
Posted by: Guest on December-02-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language