Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by VM
»
left, right and %
13 posts, Page 1 of 2
1
2
»»
left, right and %
Rate Topic
Display Mode
Topic Options
Author
Message
VM-723206
VM-723206
Posted Monday, April 20, 2009 9:29 PM
SSChasing Mays
Group: General Forum Members
Last Login: Saturday, April 06, 2013 12:20 AM
Points: 649,
Visits: 263
Comments posted to this topic are about the item
left, right and %
Post #701142
Ronald H
Ronald H
Posted Tuesday, April 21, 2009 5:21 AM
Ten Centuries
Group: General Forum Members
Last Login: Friday, November 30, 2012 1:52 AM
Points: 1,116,
Visits: 602
Hrm, why did I do left 4!
Ronald Hensbergen
Help us, help yourself... Post data so we can read and use it:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
-------------------------------------------------------------------------
2+2=5 for significant large values of 2
Post #701321
Adrian Charles Chetwynd-Talbot...
Adrian Charles Chetwynd-Talbot...
Posted Tuesday, April 21, 2009 6:15 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, November 10, 2010 5:12 AM
Points: 36,
Visits: 31
excellent question using left and right and the modulus sign .only problem remember to take the remainder for the answer not the amount left after a divide to a whole integer
Post #701361
webrunner
webrunner
Posted Tuesday, April 21, 2009 6:51 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 1:47 PM
Points: 2,118,
Visits: 2,213
Nice question. One thing would have made it harder: having a fake string conversion error as an option. Honestly, I did not know that LEFT does an implicit conversion, but because there was no error as a choice, I figured it would convert correctly and then was able to work out the right - or should I say correct - answer.
So I'm happy that I got the correct answer, but I'm not happy that I didn't know about the implicit conversion. I suppose I should be happy, though, because that means that there is always more to learn with SQL Server!
- webrunner
-------------------
"The chemistry must be respected." - Walter White
"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.:
http://tkyte.blogspot.com/2009/02/sql-joke.html
Post #701390
Chris Harshman
Chris Harshman
Posted Tuesday, April 21, 2009 6:54 AM
SSCommitted
Group: General Forum Members
Last Login: Today @ 10:20 AM
Points: 1,564,
Visits: 1,719
webrunner (4/21/2009)
...One thing would have made it harder: having a fake string conversion error as an option...
I think that would have made the question worth the 2 points assigned to it. Not sure why a simple question like this is worth 2 points without it.
Post #701395
Cliff Jones
Cliff Jones
Posted Tuesday, April 21, 2009 6:59 AM
Hall of Fame
Group: General Forum Members
Last Login: Today @ 9:58 AM
Points: 3,399,
Visits: 3,410
Chris Harshman (4/21/2009)
webrunner (4/21/2009)
...One thing would have made it harder: having a fake string conversion error as an option...
I think that would have made the question worth the 2 points assigned to it. Not sure why a simple question like this is worth 2 points without it.
It was pay back for yesterday's question. Thanks Steve.
Post #701401
OCTom
OCTom
Posted Tuesday, April 21, 2009 7:04 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 6:52 AM
Points: 2,018,
Visits: 2,852
Implicit conversion to/from strings? I would have expected an error. But, since that wasn't a choice, I calc'd it and came up with the answer. It's always nice to learn something new.
Post #701405
JF1081
JF1081
Posted Tuesday, April 21, 2009 7:54 AM
SSC-Addicted
Group: General Forum Members
Last Login: Tuesday, December 07, 2010 8:13 AM
Points: 436,
Visits: 322
I got the right and left part, I even figured it would convert as needed. What I couldn't do, was remember how Modulo worked. For some reason I thought to myself: 10 goes into 68 6 times, that must be correct. Then I got it wrong and immediately knew where I failed
Post #701464
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Tuesday, April 21, 2009 8:45 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 12:01 PM
Points: 31,436,
Visits: 13,750
I put this as two as I thought it was slightly more interesting, and required more thought, than lots of the T-SQL ones we have.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #701525
Chris Harshman
Chris Harshman
Posted Tuesday, April 21, 2009 10:47 AM
SSCommitted
Group: General Forum Members
Last Login: Today @ 10:20 AM
Points: 1,564,
Visits: 1,719
Steve Jones - Editor (4/21/2009)
I put this as two as I thought it was slightly more interesting, and required more thought, than lots of the T-SQL ones we have.
I'm not complaining, just saying I was suprised
Post #701671
« Prev Topic
|
Next Topic »
13 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.