Select date columns value which are older than 10 days from today?

  • Oh Yes, He gave me an piece of advice. It was a very nice starting so I still testing it and checking out my Table Design to reach the most correct method.

    Don't be worry. Guys

    Anyway, Thank you Everyone

  • I always worry about these types of things because I've interviewed a lot of people to be SQL Developers... a lot of them fail such simple questions because they were always able to get the answers from the internet without thinking.

    As a Senior doing a Senior project with some obvious SQL Server use in the project, I would expect you to already know this or at least be able to lookup date functions in Books Online. That's why Jack and I didn't come right out and offer you the exact answer... we wanted the student to learn how to do something in SQL rather than crib the answer off the internet. 😉

    And, no... I'm not trying to be mean... I just believe that you should have learned enough in class to do this question on your own... and, you've only learned 1 way because of it... there's a whole world of date functions, many of them in the new ANSI standards, that you missed out on because of this.

    You can still make it up to yourself... research the problem in Books Online as if you were not given the outright answer.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hello Jeff

    I'm really appreciate your concern about me. Not to make an excuse. I've really tried on many way. I looked up in the books, searched on the internet about the datetime functions. And tried them so many times.

    There are still many ways of learning. People can learn by reading, listening, studying or even asking. I'm just a guy who asking a question on a webboard which opens for asking questions. So If someone would like to help, They'll help.

    I totally understand your concern, Jeff. But I don't want you to judge me as an internet-answer-cribber.

    and I want to end this topic now.

    Again, Thank you everyone for answering and concern 🙂

    PS, sorry about my bad english 😉

  • J (3/17/2008)


    My thoghts exactly.

    FOURTH normal form? I know what it is but is it REALLY used in the real world (performance issues).

    The same can also be said about a truely 3rd normal form database (performance issues as well as historical data).

    😎

  • kaiitong (3/17/2008)


    Hello Jeff

    I'm really appreciate your concern about me. Not to make an excuse. I've really tried on many way. I looked up in the books, searched on the internet about the datetime functions. And tried them so many times.

    There are still many ways of learning. People can learn by reading, listening, studying or even asking. I'm just a guy who asking a question on a webboard which opens for asking questions. So If someone would like to help, They'll help.

    I totally understand your concern, Jeff. But I don't want you to judge me as an internet-answer-cribber.

    and I want to end this topic now.

    Again, Thank you everyone for answering and concern 🙂

    PS, sorry about my bad english 😉

    You totally missed the point... whatever.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (3/17/2008)


    kaiitong (3/17/2008)


    Hello Jeff

    I'm really appreciate your concern about me. Not to make an excuse. I've really tried on many way. I looked up in the books, searched on the internet about the datetime functions. And tried them so many times.

    There are still many ways of learning. People can learn by reading, listening, studying or even asking. I'm just a guy who asking a question on a webboard which opens for asking questions. So If someone would like to help, They'll help.

    I totally understand your concern, Jeff. But I don't want you to judge me as an internet-answer-cribber.

    and I want to end this topic now.

    Again, Thank you everyone for answering and concern 🙂

    PS, sorry about my bad english 😉

    You totally missed the point... whatever.

    Actually Jeff, I don't think he missed the point at all, I think he is avoiding it.

    One thing he is right about, different people learn differently. I've leraned I remember things better if I have to lookup or learn something on my own rather than having it just handed to me.

    😎

  • Whatever... I just think this is wrong on so many levels.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I have to agree. Just handing someone the answer to a homework problem isn't really helping them. While attending UCCS in the early 80's I worked as a Program Advisor providing assistance to students in the computer lab. Never gave them an answer, other than show them "here's your problem" after having watched them struggle for hours. They still had to figure out how to fix it.

    😎

  • I'm with the "give a hint, not the answer" group, here.

    I would have thought that if he had hit the "help" menu and asked for "Date", that he would have seen, not too far down the list, "DATEADD" and "DATEPART" and gone from there. Maybe the language barrier is higher than I thought.

  • Wow, that's an awful lot of heat for giving a one line answer to 2 or 3 day old question.

    Seriously though, I cannot see why I should judge a whole class of people differently than everyone else or deny them even a fraction of the amount of help that we freely give away to people who have 10 times the experience or who make 20 times a much. It just seems like a subtle form of discrimination to me, who they are shouldn't matter we either help people who ask for it or we don't.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Here is my thoughts. If it is for school, the OP should do as much of the work as possible. If they get stuck, ask for help to understand what is wrong. Don't expect to be just given the answer, help yourself by asking questions, and giving feedback to help your understanding.

    When it comes to assisting people with problems at work, most of us still expect the OP to provide clear details as to what they are trying to do, what they have done, provide the DDL, sample data, and expected output. I have seen several posts where the OP figured out their own problem just by going through this process. If not, those of us who try to help have enough info to actually try with out spending a lot of our own time developing a sandbox solution on our own.

    Most of us have fulltime jobs and assist here when we can because it also helps us. We post questions looking for help as well. We are just trying to give back to community.

    😎

  • Lynn Pettis (3/18/2008)


    Here is my thoughts. If it is for school, the OP should do as much of the work as possible. If they get stuck, ask for help to understand what is wrong. Don't expect to be just given the answer, help yourself by asking questions, and giving feedback to help your understanding.:cool:

    What I don't understand Lynn, is how the word "School" in your statement makes it any different than if it said "Work" instead?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • I'll through my 2 cents in as well. If the OP had posted what they had come up with, I would correct the errors gladly. When you ask a general question and do not show any effort in having tried to solve it I will try to lead you to the answer. I usually do that regardless of school or work, although I will admit to being more likely to give details to someone at work than in school for the simple reason that others are probably suffering due to the posters ignorance. A student is most likely, not necessarily always, looking for the quick and easy way to finish an assignment. I know I did in college:D

  • I keep hoping that students will try harder than most of the current set of dummies that couldn't hit the floor with their hat and don't care if they can or not. 😛 Just wishful thinking on my part... heh... stupid on my part for the most part, but wishful, none the less...

    Got any kids? Do they bring homework home? Do you do their homework for them or do you guide them when they get stuck? Maybe, show them how to find the answer in the book... try to get them to think like Jack tried to...

    So, why do I help the folks that ask work related questions on this forum? It's a bit selfish really... everytime I post, I learn something new. Sure, sure... it's nice to help folks out of a bind... Shoot, I've had to ask a question or two, myself. But I learn more when I post than the OPs do even if no one posts a different or better answer than mine. It's like practicing the piano... the more I practice, the better the player I become. And what better place to find a never ending source of "practice problems" than a forum like this?

    And, you won't believe the number of posts where they post no data and no table structure and you have to just about be a mind reader to figure out what they want... those are the ones where I'm really selfish... I try to figure out what the hell it is they really want, formulate a plan, solve the problem, and never post the answer. Does two things... gives me great satisfaction to put as much into posting the answer as they did formulating the question (close to none) and gives me practice figuring out BS requirements from people who don't actually deserve their jobs in real life. :w00t:

    And, that brings us full circle to the start of this reply... I like to see kids practice, to exercise their minds... most adults have already lost theirs so not worried about them. 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Did this topic ask for another of my perspective? No

    Do I look like want your concern? NOPE

    Did you come to answer my question? No

    Why this topic's still active since the owner of the topic said "Please end it"? I don't know

    This is enough for me. I'll unsubscribe to this topic.

    But If It's not enough for you, ENJOY YOUR TIME

    PS. If I missed out the rule that a student cannot ask a question, I'm sorry. But If there's not, please take rule description and stick it on the top. That'll be very thankful.:D

Viewing 15 posts - 16 through 30 (of 38 total)

You must be logged in to reply to this topic. Login to reply