Help with SQL Syntax for date and date range

SQL Syntax to convert this date format 26-APR-17  to yyyy-mm-dd  and then select only the records between Jan 1 2017 and Jan 1 2018. The field is this in the view EVENT_DT      DATE
kdschoolAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
What database?
0
slightwv (䄆 Netminder) Commented:
Looks like Oracle.

In Oracle the date format you posted is default.  Dates only have a format once selected and displayed.

To convert a date to a string, use TO_CHAR(your_date_column,'YYYY-MM-DD')

converting a string to a date, use TO_DATE so your select, assuming all of 2017:
select * from some_table where some_column > to_date('01/01/2017','MM/DD/YYYY') and some_column < to_date('01/01/2018','MM/DD/YYYY')
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kdschoolAuthor Commented:
Worked perfectly.
0
slightwv (䄆 Netminder) Commented:
Glad to help.

In the future, you should add the Topic Area for the database you need the answer for.  SQL is different between most of them.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.