Search
 
SCRIPT & CODE EXAMPLE
 

SQL

date to string sql

SELECT 
    TO_CHAR(SYSDATE, 'YYYY-MM-DD') 
FROM 
    dual;
Code language: SQL (Structured Query Language) (sql)
Comment

sql server datetime to string

DECLARE @dt DATETIME = '2019-12-31 14:43:35.863';

SELECT 
    CONVERT(VARCHAR(20),@dt,0) s1,
    CONVERT(VARCHAR(20),@dt,100) s2;

=========================================
                 OUTPUT
=========================================
s1                   s2
-------------------- --------------------
Dec 31 2019  2:43PM  Dec 31 2019  2:43PM

(1 row affected)
Comment

PREVIOUS NEXT
Code Example
Sql :: import file mysql terminal 
Sql :: compare date in sql 
Sql :: postgresql fill fake data 
Sql :: Syntax of for-loop in SQL Server 
Sql :: oracle ora-00054 causes 
Sql :: mysql connection string 
Sql :: oracle list user grants 
Sql :: sql server date now 
Sql :: postgres in operator with comma separated values 
Sql :: postgresql change value in column 
Sql :: select columns table mysql 
Sql :: mysql tables max count 
Sql :: shell mysql connect 
Sql :: mysql create timestamp column 
Sql :: mysql select column where has non int values 
Sql :: sql select data from last week 
Sql :: sql get count without group by 
Sql :: t-sql get duplicate rows 
Sql :: convert date to datetime sql 
Sql :: show procedures mysql 
Sql :: nosql databases list 
Sql :: oracle pl sql source 
Sql :: check if table exists oracle 
Sql :: select index table oracle 
Sql :: mysql version query 
Sql :: locate sql server 
Sql :: oracle trigger after logon on schema 
Sql :: amazon linux postgresql client 
Sql :: copy table in mysql with data 
Sql :: mysql alter table add column first 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =