Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2013
    Posts
    57

    Unanswered: How to display weekday

    Ive tried to-char, sysdate, and dual, in varying combos.
    Im trying to figure the weekday for April 30, 2008, which is wednesday.
    should result something like:

    Code:
    WEEKDAY
    -----------------
    WEDNESDAY

  2. #2
    Join Date
    Jun 2004
    Posts
    796
    Provided Answers: 1
    In a previous thread you're asked why you don't respond to questions asked by those trying to help you, and you replied "Is it hard to be so bitter, knowing that some random stranger does not bend to your wishes?"

    In light of your attitude I was considering helping you, but I refuse to bend to your wish for help.
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    How exactly did you try all of these? It is quite amazing that you didn't succeed ... Did you read (and follow) any documentation that covers TO_CHAR and date format masks?

  4. #4
    Join Date
    Dec 2012
    Location
    Logan, Utah
    Posts
    163
    we're not as advanced as create table statements yet, or insert statements, as of now.
    I'm guessing that a Select is also a bit out of your reach right now.

  5. #5
    Join Date
    Sep 2013
    Posts
    57
    Quote Originally Posted by Littlefoot View Post
    How exactly did you try all of these? It is quite amazing that you didn't succeed ... Did you read (and follow) any documentation that covers TO_CHAR and date format masks?
    I was just doing the syntax wrong.
    The issue with the other guy, well.........
    I tend to get frustrated, ask for help, go for a walk (or a drive), grab a soda, etc, and think it over. By the time I get bac, usually with a viable solution, I run the new code, and either tweak it, or move on to the next problem, while I am 'hot'.
    What I reacted to was the negative attitude I received. I don't mind saying 'Thanks' or providing feedback, but when it is not done quickly, well, I am a full time student, part time employee, groundskeeper for my small apt complex, and caregiver/errand runner for an elderly relative across town. Often, I simply get onto something else, and forget. I don't appreciate being belittled for not having the time (or the remembrance) to attend to everything.

    However, to those that may read this, I will say this: I apologize for my words, but not for the feeling that that person imparted upon me.

    Fair enough?

    BTW, I did do my 'soda run, nap, household chores' break time cure, and got the solution:

    Code:
    SQL> select to_char( date '2008-04-30', 'fmDay' ) AS WEEKDAY
      2  FROM DUAL;
    
    WEEKDAY
    ---------
    Wednesday

    And to_char, sysdate, and dual are not really covered in my text. I have no idea why, as this is a basic-level certification class. I believe the instructor wishes us to use Google quite a bit, to figure out what the book doesn't cover. That's good in some ways, but without knowing even the basic concepts behind some of these things, how can we learn about them?

  6. #6
    Join Date
    Sep 2013
    Posts
    57
    Quote Originally Posted by LinksUp View Post
    I'm guessing that a Select is also a bit out of your reach right now.
    See, CIS groupie? snarky statements like this, unsolicited, unwarranted, are things that chase those honestly seeking to learn, away.

    LinksUp, it is the first half of the semester. While I did have a very basic DB class (using MS access) previously, we didnt do much 'INSERT' or 'CREATE' work in it. Thus far in this class, halfway through, we haven't gotten there as of yet. Most clauses, some subselcts, etc is what we've got so far. Comments such as yours make it difficult for a newbie to ask for help from an educated professional.

  7. #7
    Join Date
    Jun 2004
    Posts
    796
    Provided Answers: 1
    By the time I get bac, usually with a viable solution
    If you manage to solve the problem yourself then say so. You submit multiple requests for help & then don't bother to reply when we try to help. You're not the only one on this forum asking for help, but you act as if you are. We're not all sat at our PCs waiting for you to post a thread - we're professionals, busy at our jobs but willing to spend some of our valuable time to help others if they ask for it.
    Do you go into a shop & ask the assistant if they sell a particular product then walk out before they've got back from looking? Do you phone helplines & ask a question then put the phone down before they've answered? That's what you're doing here - at least have the courtesy to let us know that you no longer need help with a particular problem.
    Often, I simply get onto something else, and forget. I don't appreciate being belittled for not having the time (or the remembrance) to attend to everything.
    At the same time that you're on here starting new threads it can't be beyond you to check back through your previous threads.
    If you need help then by all means ask, but don't then leave the room before the conversation is over.
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

  8. #8
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
      1* select hiredate, to_char(hiredate,'DAY') from emp where empno = 7934
    SQL> /
    
    HIREDATE  TO_CHAR(HIREDATE,'DAY')
    --------- ------------------------------------
    23-JAN-82 SATURDAY
    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.

  9. #9
    Join Date
    Sep 2013
    Posts
    57
    Quote Originally Posted by anacedent View Post
    Code:
      1* select hiredate, to_char(hiredate,'DAY') from emp where empno = 7934
    SQL> /
    
    HIREDATE  TO_CHAR(HIREDATE,'DAY')
    --------- ------------------------------------
    23-JAN-82 SATURDAY
    Had one like that too, solved it w/ a classmate. Amazed me cause time of day was never in the table.....
    Code:
    What time of day was TEACHER Frank Martin hired?  Display the answer with this format: hour:minutes am/pm.
    
    SQL> SELECT TO_CHAR(START_DATE, 'DD-MON-YYYY HH:MI AM')
      2  AS START_TIME FROM TEACHER
      3  WHERE UPPER(FIRST_NAME) = 'FRANK'
      4  AND UPPER(LAST_NAME) = 'MARTIN';
    
    START_TIME
    -----------------------------
    20-AUG-2013 01:23 PM

  10. #10
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    every DATE datatype column has a TIME component; which may or may not be all zeros.
    However NLS_DATE_FORMAT may be such that the TIME component is never displayed.

    Code:
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD';
    
    Session altered.
    
    SQL> SELECT SYSDATE FROM DUAL;
    
    SYSDATE
    ----------
    2013-10-15
    
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
    
    Session altered.
    
    SQL> SELECT SYSDATE FROM DUAL;
    
    SYSDATE
    -------------------
    2013-10-15 11:56:10
    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
  •