Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

left, right and % Expand / Collapse
Author
Message
Posted Monday, April 20, 2009 9:29 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Thursday, December 11, 2014 5:11 AM
Points: 654, Visits: 267
Comments posted to this topic are about the item left, right and %
Post #701142
Posted Tuesday, April 21, 2009 5:21 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, October 9, 2013 5:08 AM
Points: 1,123, Visits: 603
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
Posted Tuesday, April 21, 2009 6:15 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC 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
Posted Tuesday, April 21, 2009 6:51 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, December 19, 2014 1:33 PM
Points: 2,432, Visits: 2,868
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


-------------------
"Operator! Give me the number for 911!" - Homer Simpson

"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
Posted Tuesday, April 21, 2009 6:54 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, December 18, 2014 10:30 AM
Points: 1,950, Visits: 2,122
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
Posted Tuesday, April 21, 2009 6:59 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, November 10, 2014 12:05 PM
Points: 3,969, Visits: 3,648
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
Posted Tuesday, April 21, 2009 7:04 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 6:50 PM
Points: 2,669, Visits: 4,096
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
Posted Tuesday, April 21, 2009 7:54 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 7, 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
Posted Tuesday, April 21, 2009 8:45 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: 2 days ago @ 3:11 PM
Points: 31,368, Visits: 15,837
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
Posted Tuesday, April 21, 2009 10:47 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, December 18, 2014 10:30 AM
Points: 1,950, Visits: 2,122
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 »

Add to briefcase 12»»

Permissions Expand / Collapse