Answers for "when converting date and/or time from character string sql"

SQL
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
2

sql to char function with date

SELECT
  TO_CHAR( sysdate, 'YYYY-MM-DD' )
FROM
  dual;
Posted by: Guest on March-07-2020

Code answers related to "when converting date and/or time from character string sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language