Function Not Returning Decimal Places despite being cast as decimals

I have the little bit of code below that is not returning a decimal place for the formula so instead of something like 4.55 I’m only getting a 4.00 any help would be appreciated thank you.

CAST(datediff(mi,ord_startdate,ord_completiondate)/60 as decimal (10,2))

  • Converting SQL CASE WHEN statement into C#
  • How to group by multiple columns in SQL Server
  • sql group by order by and top in a same query
  • Spring Boot/HikariCP @Transactional not overwriting isolation level
  • IF EXISTS, THEN SELECT ELSE INSERT AND THEN SELECT
  • SSRS: How many reports have been sent out within 24hrs
  • One Solution collect form web for “Function Not Returning Decimal Places despite being cast as decimals”

    You are performing integer division (60 vs 60.0) and casting the result of that division as decimal(10,2). Try this instead:

    CAST(datediff(mi,ord_startdate,ord_completiondate)/60.0 as decimal (10,2))
    
    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.