Babo
Babo

Reputation: 375

How to get date from datetime from database in SQL

This is my query to get the current date time. I don't know how to fetch only the date

SELECT SENT_TIME 
FROM APP_STATUS_WEBSERVICE 
WHERE APP_ID_EFAS = 809371

The result of this query:

enter image description here

Here it shows 22 October 2022, I just want to get the 22 only. How to do that?

I want display only date: 22

Upvotes: -1

Views: 42

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521239

Just use the DAY() function:

SELECT DAY(SENT_TIME) AS SENT_TIME_DAY
FROM APP_STATUS_WEBSERVICE
WHERE APP_ID_EFAS = 809371;

Upvotes: 2

Related Questions