pl/sql date format [message #596494] |
Mon, 23 September 2013 23:45 |
|
vivek_veri
Messages: 8 Registered: September 2013 Location: INDIA
|
Junior Member |
|
|
how to write pl/sql to create date o/p like .
since we wnat to design pl/sql report wich will generate monthwise sale from 01jan2009 to 01-sep-2013.
we have created funtion wich will accept argument as employee no, from date and to date.
from_date to_date
01-JAN-2009 01-FEB-2009
01-FEB-2009 01-MAR-2009
01-MAR-2009 01-APR-2009
01-APR-2009 01-MAY-2009
01-may-2009 01-JUN-2009
01-JUN-2009 01-JUL-2009
regards
viv
|
|
|
|
Re: pl/sql date format [message #596562 is a reply to message #596494] |
Tue, 24 September 2013 13:42 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
So what is your question, exactly?
Dates should be stored in tables and handled in PL/SQL variables as datatype DATE. That is an internal, binary format that includes both date and time components. If you want to PRESENT them in a report in a particular format, you feed the DATE variable/column through the TO_CHAR function, specifying a format mask to format it however you like.
With a more precise question, we could provide a more precise answer.
[Edit MC: remove unnecessary full quote of OP's post]
[Updated on: Tue, 24 September 2013 13:49] by Moderator Report message to a moderator
|
|
|
Re: pl/sql date format [message #596595 is a reply to message #596562] |
Wed, 25 September 2013 02:22 |
|
vivek_veri
Messages: 8 Registered: September 2013 Location: INDIA
|
Junior Member |
|
|
thanks blackswan . i have implemented that monthwise, yearwise and weekwise quiers in my report. it helped lot
if we want hourwise details of current day. for examp. todays date is 25sep2013.
from date to_date
25-sep-2013 00:00:00 25-sep-2013 01:00:00
25-sep-2013 01:00:00 25-sep-2013 02:00:00
25-sep-2013 02:00:00 25-sep-2013 03:00:00
25-sep-2013 03:00:00 25-sep-2013 04:00:00
25-sep-2013 04:00:00 25-sep-2013 05:00:00
[Updated on: Wed, 25 September 2013 02:23] Report message to a moderator
|
|
|
|