# decimal to sexagesimal (also decimal format)

### Question

• Hi,

I wonder if there is an easy way to change from decimal to decimal (but in sexagesimal format).

Example:

44.73=44.44 (44 hours, 44 minutes)

thanks a lot!
Thursday, July 04, 2013 7:16 AM

• Try:

```DECLARE @decimal decimal(4,2) = 44.73

-- 44.73	44.44
```

Kalman Toth Database & OLAP Architect sqlusa.com
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

• Marked as answer by Thursday, July 04, 2013 8:32 AM
Thursday, July 04, 2013 7:35 AM

### All replies

• SELECT LEFT(CAST(44.73 AS VARCHAR(10)),2)+ ' hours '
+CAST((7.3*6.0) AS VARCHAR(20)) +' minutes'

Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

MS SQL optimization: MS SQL Development and Optimization
MS SQL Blog: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance

Thursday, July 04, 2013 7:33 AM
• Try:

```DECLARE @decimal decimal(4,2) = 44.73

-- 44.73	44.44
```

Kalman Toth Database & OLAP Architect sqlusa.com
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

• Marked as answer by Thursday, July 04, 2013 8:32 AM
Thursday, July 04, 2013 7:35 AM
• Try

```declare @dec decimal(16,2)
set @dec=44.73
select cast(cast(floor(@dec) as int) as varchar)+' hour, '+cast(cast((ceiling((@dec-floor(@dec))*60)) as int) as varchar)+' minute'
```

Many Thanks & Best Regards, Hua Min

Thursday, July 04, 2013 7:37 AM
• This one seems good
Thursday, July 04, 2013 8:32 AM