4
Today, man SELECT
returns the following date:
2017-11-16 10:37:16.000
I’d like you to return 2017-11-16 00:00:00.000
, can help me with this formatting?
4
Today, man SELECT
returns the following date:
2017-11-16 10:37:16.000
I’d like you to return 2017-11-16 00:00:00.000
, can help me with this formatting?
3
You can use the format and spend the zeroed part of hours. Ex:
SELECT FORMAT(GETDATE(), 'yyyy-MM-dd 00:00:00') AS DATE;
0
Another option would be like this:
SELECT to_char(DATA, 'yyyy-MM-dd 00:00:00.000') AS DATE from TBL_DATAS;
Browser other questions tagged sql sql-server datetime
You are not signed in. Login or sign up in order to post.
What is your database? Post your SQL command
– R.Santos
I don’t know much about formatting, I’m using a normal select "SELECT DATA FROM TBL_DATAS"
– user90864
what is your young database ? mysql, Firebird, sql-server, postgres ?
– Rovann Linhalis
What is your database? You want to return hours or just date (yyyy-MM-dd) enough?
– R.Santos
The database is Sql Server
– user90864
I need you to return the second zeroes R. Santos
– user90864
then use SELECT CURDATE() and take only the date, since you want the minutes, seconds and time reset, there will be no difference for you
– Victor
@user90864 Any of the answers resolve your need? If yes just mark it as correct to help future people who may have the same difficulty finding the answer faster
– R.Santos