Answers for "convert string to varchar in sql"

SQL
0

convert int to varchar sql

SELECT convert(varchar(10), field_name) FROM table_name;
SELECT str(field_name) FROM table_name;
Posted by: Guest on May-08-2021
1

How to convert DateTime to VarChar SQL

-- Create test case
DECLARE @myDateTime DATETIME
SET @myDateTime = '2008-05-03'
-- Convert string
SELECT LEFT(CONVERT(VARCHAR, @myDateTime, 120), 10)
Posted by: Guest on July-28-2021

Code answers related to "convert string to varchar in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language