Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #convert #DateTime #VarChar #SQL
ADD COMMENT
Topic
Name
4+7 =