Skip to content
Advertisement

How to get Date only from the datetime value?

I have an netezza SQL database field that looks like the examples below:

2019-10-01 18:51:32.847000000
2019-10-01 18:50:21.177000000
2019-10-01 18:50:56.883000000

Is there a way to select the first set of date to be date only like below:

2019-10-01
2019-10-01
2019-10-01

Advertisement

Answer

Try to use built-in function DATE() in the following:

SELECT DATE(column_name) AS DateOnly
FROM tbl
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement