Q

Datepart function in Oracle

I want to use the datepart function to get the month of my variable. Is this allowed in Oracle or am I off on the syntax?

I want to use the datepart function to get the month of my variable:
 Datepart(month,ABC_Date)
Is this allowed in Oracle or am I off on the syntax?
Oracle does not have a datepart function. But the syntax:
 Datepart(month,abc_date) = '03'
can be converted to the following in the Oracle date routine:
 to_char(abc_date,'mm') = '03'
This was first published in August 2006

Dig deeper on Oracle and SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close