## How to convert kilograms to pounds and ounces

 Author Message NineIron SSChampion Group: General Forum Members Points: 10794 Visits: 911 I'm need to convert kilograms to pounds and ounces. See attached data.`create table #T(ID,Weight decimal(10,2))insert into #T(ID,PtWeight) values(1,58.3)insert into #T(ID,PtWeight) values(2,45.3)insert into #T(ID,PtWeight) values(3,64.5)insert into #T(ID,PtWeight) values(4,52.2)insert into #T(ID,PtWeight) values(5,63.2)insert into #T(ID,PtWeight) values(6,65.4)insert into #T(ID,PtWeight) values(7,71.2)insert into #T(ID,PtWeight) values(8,85.6)insert into #T(ID,PtWeight) values(9,25.5)insert into #T(ID,PtWeight) values(10,26)insert into #T(ID,PtWeight) values(11,45.9)insert into #T(ID,PtWeight) values(12,76.4)` John Mitchell-245523 SSC Guru Group: General Forum Members Points: 135266 Visits: 19483 Multiply by 2.2 to convert to pounds and multiply the resulting decimal part by 16 to get the ounces.John ScottPletcher SSC Guru Group: General Forum Members Points: 87000 Visits: 9747 Or perhaps multiply by 2.2046226218, or some shorter variant of that, if you need more accuracy. 2.2 is rather rough estimate. SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them. John Mitchell-245523 SSC Guru Group: General Forum Members Points: 135266 Visits: 19483 +xScottPletcher - Friday, December 29, 2017 8:18 AMOr perhaps multiply by 2.2046226218, or some shorter variant of that, if you need more accuracy. 2.2 is rather rough estimate.Understood. I thought of looking up the exact number, but then I figured that the original poster is just as capable of doing that as I am.John ScottPletcher SSC Guru Group: General Forum Members Points: 87000 Visits: 9747 +xJohn Mitchell-245523 - Friday, December 29, 2017 8:23 AM+xScottPletcher - Friday, December 29, 2017 8:18 AMOr perhaps multiply by 2.2046226218, or some shorter variant of that, if you need more accuracy. 2.2 is rather rough estimate.Understood. I thought of looking up the exact number, but then I figured that the original poster is just as capable of doing that as I am.JohnIdk, if OP was willing to do that, would prob never have asked the q to begin with SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them. NineIron SSChampion Group: General Forum Members Points: 10794 Visits: 911 Thanx but, how can I get the decimal part to multiply by 16. I think it has something to do with "%". John Mitchell-245523 SSC Guru Group: General Forum Members Points: 135266 Visits: 19483 No, just subtract the integer part, which you get by using FLOOR.John NineIron SSChampion Group: General Forum Members Points: 10794 Visits: 911 Given a weight of 68.6 kg. Is this the best way to do it?select concat(floor((68.6*2.2)),' lbs ',((68.6*2.2)%1)*16,'oz') as PtWeight John Mitchell-245523 SSC Guru Group: General Forum Members Points: 135266 Visits: 19483 You don't want to do the calculation twice if you don't have to. Try this:`SELECT CONCAT(F.FloorWeight,'lbs ',(W.WeightinPounds - F.FloorWeight)*16,'oz') as PtWeightFROM #T tCROSS APPLY ( SELECT t.PtWeight * 2.2 ) W(WeightinPounds)CROSS APPLY ( SELECT FLOOR(W.WeightinPounds) ) F(FloorWeight)`John NineIron SSChampion Group: General Forum Members Points: 10794 Visits: 911 Thanx. Happy New Year.