SQL Language (MOSC)

MOSC Banner

Date Formatting Question

edited Feb 18, 2010 5:17AM in SQL Language (MOSC) 14 commentsAnswered ✓
 Hi Folks

I am trying to figure out what I am missing here when trying to use to_char and to_date in my code

i have broken it down to just using sysdate and dual so if someone can help me on this i would appreciate it

if i do

select sysdate from dual where to_char(sysdate,'yyyy/mm/dd') = '2009/09/25';

i get

SYSDATE
---------
25-SEP-09

if i do

select sysdate from dual where sysdate = to_date ('2009/09/25','yyyy/mm/dd');

i get

no rows selected

so i cannot figure out why the second sql returns nothing

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center