Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2013
    Posts
    2

    Unanswered: Help!!!! date function!

    I am taking a SQL class at a local community college and we are studying dates this week but I have a question that I can't figure out and it has actually made me late with my assignment. the question is- What is the name of the last day of the month of April 2008 ? can anyone tell me where I should be starting with this question because it has me confused.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    when all else fails, Read The Fine Manual

    LAST_DAY
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Dec 2007
    Posts
    253
    Quote Originally Posted by anacedent View Post
    when all else fails, Read The Fine Manual

    LAST_DAY
    That wouldn't supply the name of the last date though.

    @OP, I think that you need to_char() with the appropriate format mask

  4. #4
    Join Date
    Oct 2013
    Posts
    2
    EVENT_ID CLASS_ID EVENT_NAME EVENT_DAT T RAIN_DATE
    ---------- ---------- ------------------------- --------- - ---------
    1 9 ASTRO Physics STAR GAZING 09-NOV-99 O
    2 10 Flag FOOtball Game 19-JAN-99 O 20-JAN-99
    3 1 Guest SPEAKER 01-DEC-99 I
    4 8 Barney ViDeo 01-SEP-99 I
    5 10 PICKUP SOCCER GAME 09-JUL-99 I 10-JUL-99
    6 2 Guest Speaker 20-NOV-99 I
    this is the table we have been using so far.

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >this is the table we have been using so far.
    based upon the sample data in the table above what should be the correct answer & why?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Burtman, what is relation between "table you have been using so far" (i.e. data you provided) and "name of the last day of the month of April 2008"?

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
      1* select to_char(last_day(to_date('JAN-1970','MON-YYYY')),'DAY') from dual
    SQL> /
    
    TO_CHAR(L
    ---------
    SATURDAY
    http://www.rocketcalendar.com/calendar/1970-01
    Last edited by anacedent; 10-20-13 at 13:19.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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