Log in  ::  Register  ::  Not logged in

 Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Coalesce and Conversion Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, January 08, 2013 7:20 AM
 SSChampion Group: General Forum Members Last Login: Friday, March 07, 2014 3:03 PM Points: 11,569, Visits: 10,681
 Good question Tom. Good to have a refresher on these things from time to time. _______________________________________________________________Need help? Help us help you. Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.Need to split a string? Try Jeff Moden's splitter.Cross Tabs and Pivots, Part 1 – Converting Rows to Columns Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs Understanding and Using APPLY (Part 1)Understanding and Using APPLY (Part 2)
Post #1404232
 Posted Tuesday, January 08, 2013 8:25 AM
 Hall of Fame Group: General Forum Members Last Login: Today @ 6:55 AM Points: 3,606, Visits: 4,723
 Tripped myself on this one.Thanks Tom, learned something today, so I guess that makes it worthwhile ____________________________________________Space, the final frontier? not any more...All limits henceforth are self-imposed.“libera tute vulgaris ex”
Post #1404277
 Posted Tuesday, January 08, 2013 9:14 AM
 SSCommitted Group: General Forum Members Last Login: Thursday, February 27, 2014 12:25 PM Points: 1,891, Visits: 10,939
 Excellent question, and great explanation! Thanks! Rob SchripsemaAccelitec, Inc
Post #1404316
 Posted Tuesday, January 08, 2013 10:32 AM
 SSCommitted Group: General Forum Members Last Login: Tuesday, January 21, 2014 8:55 AM Points: 1,520, Visits: 3,035
 How annoying. You made me think! ;) I agree this was an excellent question and explanation. I do see that one minor correction could be needed to one example given, however. You say "...for example the numeric value 37.2 can be converted to an int (37)...". Did you actually mean that an INT (@i) could be converted to the higher precedence numeric type, as obviously could be the literal value 37.2? After all, the result of that coalesce is 37.2 and not 37.
Post #1404373
 Posted Tuesday, January 08, 2013 12:07 PM
 SSCarpal Tunnel Group: General Forum Members Last Login: Friday, March 07, 2014 1:51 PM Points: 4,155, Visits: 3,230
 A really good QotD. Thanks, Tom!
Post #1404418
 Posted Tuesday, January 08, 2013 10:07 PM
 Ten Centuries Group: General Forum Members Last Login: Today @ 5:10 AM Points: 1,371, Visits: 1,545
 Very nice question Tom. Learnt something new today ~ Lokesh Vij Guidelines for quicker answers on T-SQL questionGuidelines for answers on Performance questionsLink to my Blog Post --> www.SQLPathy.comFollow me @Twitter
Post #1404540
 Posted Tuesday, January 08, 2013 10:20 PM
 SSC Rookie Group: General Forum Members Last Login: Thursday, January 24, 2013 6:08 AM Points: 28, Visits: 136
 thanks good and very tough question! _______________________________________________________________"The best way to prepare for programming is to write programs, and to study great programs that other people have written." – Bill Gates
Post #1404541
 Posted Wednesday, January 09, 2013 12:01 AM
 Hall of Fame Group: General Forum Members Last Login: Thursday, March 06, 2014 8:23 AM Points: 3,493, Visits: 2,600
 Great question, must say. +1
Post #1404562
 Posted Wednesday, January 09, 2013 7:03 AM
 SSChasing Mays Group: General Forum Members Last Login: Friday, March 07, 2014 9:19 AM Points: 638, Visits: 1,477
 Interesting question, thank you Tom.(even kind of knowing the output for each select statement, it tempted me to challenge self and to prove it) ww; Raghu--There are only 10 types of people in the world, those who understand binary, and those who don't.Note: (as of now) only.. 1 and 4 applies (i am on my way...)
Post #1404756
 Posted Wednesday, January 09, 2013 7:35 AM
 SSCommitted Group: General Forum Members Last Login: Friday, March 07, 2014 7:50 AM Points: 1,676, Visits: 1,202
 Thanks for the great question Tom. It really made me think; there were so many choices and it was so early in the morning. I can definitely say I'm awake now. Yeah, uh huh, you know what it is. Everything I do, I do it big
Post #1404786

 Permissions