Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008
    Posts
    16

    Unanswered: Working with dates

    Hi,
    I need someone to help me.
    I am expecting the following,
    when i give input as a year i need the output with the first and last date of that year.

    Eg :

    I/P: 2006
    O/P : 01-Jan-2006 and 31-Dec-2006.

    Can someone help me in this..

    Thanks in advance..

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    You'll need to TRUNCate the date (TO_DATE) representation of the year to 'yyyy' in order to get the first day of the year. Once you manage to do that, simply add 12 months (ADD_MONTHS) to the "first day" and subtract 1 day.

    Try it by yourself; if you are still unable to do that, return back here and provide code you've used.

  3. #3
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Why even access the database for this? It can be done a lot cheaper without that trip

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Quote Originally Posted by dav1mo
    Why even access the database for this? It can be done a lot cheaper without that trip
    Depends where you are at the time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •