Query

  • Maybe I'm missing something, but I would think that datename(m,join_date) like '%a%' would also pull data for the month of August effectively rulling it out as a possbile solution, but hey, it's Monday and I'm probably still asleep...

  • dob = date of birth

    date of birth does not have any relationship to join date unless the table is in the Almighty's db.

    😀

  • pbyrne (4/7/2008)


    Maybe I'm missing something, but I would think that datename(m,join_date) like '%a%' would also pull data for the month of August effectively rulling it out as a possbile solution, but hey, it's Monday and I'm probably still asleep...

    Yes it would pull august that's why the question was posed as... "Jan, Feb, March, April, May, Aug"

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I figured "dob" was a trap to see if we were reading the choices fully.

    Of course, no one would REALLY check a date field by using the like '%a%' method, so I figured the whole point of the question was to demonstrate that the datename function returns the full word, not a 3-character abbreviation.

    BUT, this does remind me of a saying my mother used to say to me often:

    "No swimming in the lake in any month that has an "r" in it" 😛

  • Jack Corbett (4/7/2008)


    I just have a couple of questions for all who have posted about this issue, did you respond to the QOD survey that was released recently? Also have you ever submitted a QOD? I agree that the first option is not a correct answer based on the question, but what are you and I doing to improve things?

    Thanks - I did not notice a QOD survey - do you have a link for it you could provide?

    Thanks again!

    -webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Getting tired, so very tired of sloppily worded questions ...

    dob not defined as a column name in the table or for that matter anywhere in question ... so it can not, and will not return the correct values :w00t:

    If a DBA was as careless as some of these last few questions, he/she would be looking for a job PDQ. (Pretty darn quick).

    Proposed it twice before and will propose it again.

    Steve ask for volunteers to be appointed to a panel that checks and double checks these question BEFORE they are published as the QOD.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • As everyone else has pointed out, dob is not the column name given in the question as the column in question. Option A should read month(join_date) in (1,2,3,4,5,8) if it is indeed supposed to be a valid answer.

  • Geeze, here we go again. I can no longer accept that it's just poor/no editing or piss poor authors that create these incorrect "correct" answers. This has to be a conscious effort to drive up the postings to get better advertising stats. I'm pretty sick of it.

    Regards,

    Greg Young

  • The datename() function returns the full name of the month, not the abbreviated form, and so the comparison term would be February, not Feb, and thus it would match %a%.

    A more compelling argument against answer B is given by Robert, who argues that if the system language is not English there is a good chance that the second month of the year will not have an a in the name, so using datename() is not 100% reliable in every context.

  • test test test before posting questions....

  • Hi Jack,

    Jack Corbett (4/7/2008)


    I just have a couple of questions for all who have posted about this issue, did you respond to the QOD survey that was released recently?

    Yes.

    Also have you ever submitted a QOD?

    No.

    I agree that the first option is not a correct answer based on the question, but what are you and I doing to improve things?

    I don't know about you, but what I am doing can be read a few pages back - I post a correction and some background information, hoping that at least some of the thousands of viewers this site has sees the correction and won't take away any incorrect information from visiting this site. (Based on the number of comments that add nothing to what was posted before, I doubt if many bother to read what others post, but if it helps just a single person, it's been a worthwile investment of my time).

    I know it's hard to come up with questions - I've been a member of an examination committee so I've been there myself. I don't blame Steve for lacking the time to doublecheck each and every question. I don't blame the authors(*) of faulty questions either, as they are but humand and are therefore unable to know everything. I do want to try to prevent misinformation spreading.

    (*) There have been exceptions. There have been questions where I did think (and write) that the author should have known better. This question is not one of those, though I have to admit that including the LIKE '%a%' solution without a disclaimer never to use this for real work makes it a borderline situation.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • webrunner (4/7/2008)


    Jack Corbett (4/7/2008)


    I just have a couple of questions for all who have posted about this issue, did you respond to the QOD survey that was released recently? Also have you ever submitted a QOD? I agree that the first option is not a correct answer based on the question, but what are you and I doing to improve things?

    Thanks - I did not notice a QOD survey - do you have a link for it you could provide?

    Thanks again!

    -webrunner

    I tried to find the link to it and did not, even though I know I filled it out. I have posted in the suggestions forum that they put a link to it on the QOD page.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • Hi Bitbucket,

    bitbucket (4/7/2008)


    Proposed it twice before and will propose it again.

    Steve ask for volunteers to be appointed to a panel that checks and double checks these question BEFORE they are published as the QOD.

    If Steve decides to adopt this idea, I'll gladly volunteer to be in the panel.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • yeah, assuming dob is date of birth, we are talking of joining date, not DOB, doob!

    The first option would have been okay if dob was replaced by join_date. :w00t:

  • Jignesh, datename(m, join_date) gives the complete month name, not abbreviated name.

Viewing 15 posts - 46 through 60 (of 95 total)

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