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

 TSQL Challenge 51 - Convert long Binary strings to Decimal strings Rate Topic Display Mode Topic Options
Author
 Message
 Posted Monday, March 7, 2011 12:05 AM
 SSC-Addicted Group: General Forum Members Last Login: Tuesday, December 24, 2013 4:42 AM Points: 460, Visits: 2,523
 Comments posted to this topic are about the item TSQL Challenge 51 - Convert long Binary strings to Decimal strings .
Post #1073966
 Posted Monday, March 7, 2011 8:03 AM
 Right there with Babe Group: General Forum Members Last Login: Wednesday, November 25, 2015 9:38 AM Points: 775, Visits: 266
 Not able to reach the site with the link provided the Site. The answer could be ;WITH CTEAS( SELECT SEQ, BINARYVALUE, 0 AS EXPO, CONVERT(NVARCHAR(4000),RIGHT(BINARYVALUE,1)) REMAINING , CONVERT(NVARCHAR(4000),LEFT(BINARYVALUE,LEN(BINARYVALUE) - 1)) DEDUCTIBLE FROM TC51 UNION ALL SELECT SEQ, BINARYVALUE, EXPO + 1, CONVERT(NVARCHAR(4000),RIGHT(DEDUCTIBLE,1)) ,CONVERT(NVARCHAR(4000),LEFT(DEDUCTIBLE,LEN(DEDUCTIBLE) - CASE WHEN LEN(DEDUCTIBLE) > 0 THEN 1 ELSE 0 END )) DEDUCTIBLE FROM CTE WHERE LEN(DEDUCTIBLE) > 0)sELECT SUM(remaining * power(CONVERT(NUMERIC(18,0),2),expo)),seq, binaryvalueFROM CTEgroup by seq, binaryvalueorder by seq, binaryvalueIf there is any better method, please let me know how can I view it?
Post #1074182
 Posted Monday, March 7, 2011 8:51 AM
 SSC-Addicted Group: General Forum Members Last Login: Tuesday, December 24, 2013 4:42 AM Points: 460, Visits: 2,523
 Most people submit their solutions in the first two weeks after the challenge is published. The evaluation then might take another 2-4 weeks to complete. The solutions will be available publicly after the evaluation is completed. I would encourage you to go to http://beyondrelational.com/puzzles/sqlserver/tsql/51/submit.aspx and submit your solution. .
Post #1074218

 Permissions