Answers for "how to seta date format in sql query"

SQL
-1

date format in sql

SELECT CONVERT(VARCHAR, GETDATE(),101) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),102) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),103) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),104) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),105) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),106) AS DATE

SELECT DATE = FORMAT(GETDATE(), 'dd-MM-yyyy')
Posted by: Guest on June-24-2021
0

sql change date format

-- Oracle
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MM-YYYY HH24:MI:SS';
SELECT sysdate FROM dual;

SELECT to_char(sysdate,'HH24:MI:SS') FROM dual;
Posted by: Guest on August-15-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language