difference between max(datecolumn) and max(to_date(datecolumn),'dd-mm-rrrr')
hi all
when i use
select max(datecolumn) from atable ;
it gives
31-may-03
but when
select max(to_date(datecolumn),'dd-mm-rrrr) from atable ;
it gives
03-jul-03
second query is giving correct result.
please note that type datecolum is date
what is the difference ???
we r using win2000 and oracle 8.1.7
P.soni
Re: difference between max(datecolumn) and max(to_date(datecolumn),'dd-mm-rrrr')
Quote:
Originally posted by PSoni
select max(to_date(datecolumn),'dd-mm-rrrr) from atable ;
This has two syntax errors - so I don't think this is what gave the output posted.
Quote:
Originally posted by PSoni
please note that type datecolum is date
Are you 100% sure? The results suggest that it is a character column - 31 is the highest value for the first two characters.
Re: Re: difference between max(datecolumn) and max(to_date(datecolumn),'dd-mm-rrrr')
This has two syntax errors - so I don't think this is what gave the output posted.
PLEASE READ IT AS
select max(to_date(datecolumn,'dd-mm-rrrr)) from atable ;
Are you 100% sure? The results suggest that it is a character column - 31 is the highest value for the first two characters.
YES ITS DATE COLUMN
P.SONI
Re: Re: Re: difference between max(datecolumn) and max(to_date(datecolumn),'dd-mm-rrrr')
Quote:
Originally posted by PSoni
PLEASE READ IT AS
select max(to_date(datecolumn,'dd-mm-rrrr)) from atable ;
Still missing a quote here ;)
I believe datecolumn is a character column.