creating index on datepart of datetime field
883189Sep 9 2011 — edited Sep 10 2011Hello all,
I need to create an index on date part of datetime field column. My sample datefiled column values are as follows:
10/24/2009 12:09:58 PM
10/25/2009 7:05:19 AM
10/20/2009 9:52:25 AM
10/29/2009 11:5:21 PM
10/30/2009 9:8:17 PM
Which function can be used to create index - to_date or to_char ?
I tried running the following querys :
create index tmp on table1(to_date(datecolumn,'DD-MM-YYYY'));
create index tmp on table1(to_char(datecolumn,'mm/dd/yyyy'));
the above two querys works.
But below query doesn't wrk..
create index tmp on table1(to_date(datecolumn,'mm/dd/yyyy'));
why and which to use and how?
help is really appreciated...thanks in advance