Today my SELECT
returns the following date:
2017-11-16 10:37:16.000
I would like to return 2017-11-16 00:00:00.000
, can you help me with this formatting?
Today my SELECT
returns the following date:
2017-11-16 10:37:16.000
I would like to return 2017-11-16 00:00:00.000
, can you help me with this formatting?
You can use the format and move the time zone to zero. Ex:
SELECT FORMAT(GETDATE(), 'yyyy-MM-dd 00:00:00') AS DATE;
Another option would look like this:
SELECT to_char(DATA, 'yyyy-MM-dd 00:00:00.000') AS DATE from TBL_DATAS;