Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Query


Query

Author
Message
Jeff Deluca
Jeff Deluca
Mr or Mrs. 500
Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)

Group: General Forum Members
Points: 543 Visits: 229
I can understand looking at the QotD as a puzzle sometimes and not always from a 'best practices' perspective.

Good point Steve.
Pablo Rafael
Pablo Rafael
SSC-Addicted
SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)SSC-Addicted (474 reputation)

Group: General Forum Members
Points: 474 Visits: 104
I think we should stop this.
Personally I have not put the message claiming nothing, but to joke with the situation.
(See my message emoticons, which are for that)

Nobody will die for a point less so, in my humble opinion, it should not make a scandal of it.

I never would have imagined it was going to create this problem. Had I known beforehand, I do not write anything.

I believe that neither Steve Jones nor the rest of the moderators, deserve to be accused in this way.

Stop, guys, please.


Greetings From Argentina!

Pablo

Linson.Daniel
Linson.Daniel
Old Hand
Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)

Group: General Forum Members
Points: 315 Visits: 391
Regardless of the presence of dob in the author s answer, I feel that the answer provided by the author is not right.
The first option "Month(join_date) In (1,2,3,4,5,8)" would be the rigth answer with respect to the question he has asked.

A word to the Author of the question:
I suggest you have another look at your question !!Doze
mtassin
mtassin
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4101 Visits: 72512
I hate to beat this dead horse, but the corrected question/answer went out today.


Explanation: Either of the first two answers will work. All the month names have at least the letter 'a' once. The month function returns the number of the month, that can be compared against the month number of given months


In Spanish, the month of february is febrero, in french it's Février, etc... and depending on the language settings your SQL server is set to, you'll get different results.
Because of that, datename(m,join_date) like '%a%' is not 100% valid.



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
Shaun McGuile
Shaun McGuile
Mr or Mrs. 500
Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)

Group: General Forum Members
Points: 585 Visits: 1060
Is the question poster a US citizen by any chance? BigGrin

it would explain the 'english' bias of the question.

Hiding under a desk from SSIS Implemenation Work Crazy
mtassin
mtassin
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4101 Visits: 72512
Shaun McGuile (4/8/2008)
Is the question poster a US citizen by any chance? BigGrin

it would explain the 'english' bias of the question.


I'm a US Citizen... doesn't change the fact that I'm cognizant of the fact that there are other languages out there.



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
Shaun McGuile
Shaun McGuile
Mr or Mrs. 500
Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)Mr or Mrs. 500 (585 reputation)

Group: General Forum Members
Points: 585 Visits: 1060
So it was not really a bad question....

Just a poorly written set of answers. Whistling
--Shaun

Hiding under a desk from SSIS Implemenation Work Crazy
Christian Buettner-167247
Christian Buettner-167247
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2949 Visits: 3889
I like the math here ;-)

Correct answers: 72% (966)

--------------------------------------------------------------------------------
month(join_date) in (1,2,3,4,5,8) 61%
datename(m,join_date) like '%a%' 37%
Not in List 26%
--------------------------------------------------------------------------------

Or was Steve just hacking into the table directly BigGrin

I also had it wrong, but how do ya say? *$%# happens.
Let he who is without bugs, cast the first stone... (it's
not me of course)

Best Regards,

Chris Büttner
Noffer
Noffer
SSC Veteran
SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)SSC Veteran (294 reputation)

Group: General Forum Members
Points: 294 Visits: 122
... And what about the Not in List option? I didn't see DATEPART(month,join_date) in (1,2,3,4,5,8) in the list, so that should be a valid option too
aarif.pd
aarif.pd
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 7
The first option is the only correct one when you take into account languages etc. The second option only true for some languages.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search