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))

  • What is the best way to copy a database?
  • Manually specify starting value for Row_Number()
  • SQL Server Integrated Security from an Azure Web Site
  • Does T-SQL have an aggregate function to concatenate strings?
  • Very different execution times of SQL query in C# and SQL Server Management Studio
  • Efficiently select random rows from large resultset with LINQ (ala TABLESAMPLE)
  • 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.