Home » SQL & PL/SQL » SQL & PL/SQL » Figuring out the years and sorting by month
Figuring out the years and sorting by month [message #1600] Wed, 15 May 2002 09:52 Go to next message
Dave
Messages: 92
Registered: August 1999
Member
When you get the years from sysdate-date/365 how do you produce the months?
Also how do you sort by months, ie Jan-Dec.
Re: Figuring out the years and sorting by month [message #1612 is a reply to message #1600] Thu, 16 May 2002 00:09 Go to previous message
seng
Messages: 191
Registered: February 2002
Senior Member
i think you can use "to_char" to get the date,month, year and time(in string). To get the month, you need to reconvert back to date with "to_date" .

e.g
to_char('dativariable','dd/mm/yyyy hh:mm:ss');
to_date('dativariable','dd/mm/yyyy hh:mm:ss');

hope this is helping
Previous Topic: Copy Command Error Message
Next Topic: cursor
Goto Forum:
  


Current Time: Fri Apr 19 01:45:36 CDT 2024