Convert float to hours and minutes in this script

I would like to the diff(float) field to convert to hours and minutes. Am relatively new and don't know how to incorporate this into the below:

SELECT UserId, WorkDate, FirstIn, LunchOut, LunchIn, FinalOut, '07:00' As Roster,
     CONVERT(varchar(5), DATEADD(MINUTE, DATEDIFF(MINUTE, FirstIn, FinalOut) - 
         ISNULL(DATEDIFF(MINUTE,LunchOut, LunchIn), 0), 0), 8) AS Time_Worked,
         CONVERT(float(5), DATEADD(MINUTE, DATEDIFF(MINUTE, FirstIn, FinalOut) - 
         ISNULL(DATEDIFF(MINUTE,LunchOut, LunchIn), 0), 0), 8) AS DIFF
 FROM (
     SELECT 
         UserId, CAST(DATEADD(DAY, DATEDIFF(DAY, 0, [when_adjusted]), 0) AS date) AS WorkDate,
         ---MAX(CASE WHEN INOUT = 2 THEN '00:50' END) AS LunchFlex,
         MIN(CASE WHEN INOUT = 0 THEN [when_adjusted] END) AS FirstIn,
         MAX(CASE WHEN INOUT = 2 THEN [when_adjusted] END) AS LunchOut,
         MAX(CASE WHEN INOUT = 3 THEN [when_adjusted] END) AS LunchIn,
         MAX(CASE WHEN INOUT = 1 THEN [when_adjusted] END) AS FinalOut
     FROM [Safescan].[dbo].[attendant]
     CROSS APPLY (
         SELECT 
             CASE WHEN DATEPART(HOUR, [WHEN]) = 3 THEN DATEADD(MINUTE, CEILING(DATEDIFF(MINUTE, 0, [WHEN]) / 15.0) * 15, 0)
                  WHEN DATEPART(HOUR, [WHEN]) = 2 THEN DATEADD(MINUTE, FLOOR(DATEDIFF(MINUTE, 0, [WHEN]) / 15.0) * 15, 0)
                  ELSE [WHEN]
                 END AS when_adjusted
     ) AS adjust_when
     GROUP BY USERID, DATEADD(DAY, DATEDIFF(DAY, 0, [when_adjusted]), 0)
 ) AS derived
 ORDER BY WorkDate

Open in new window

SimonJohnGAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
This question is here for 10 days already and no Experts tried to answer. I'm wondering if isn't for the lack of information.
I would like to the diff(float) field to convert to hours and minutes
Where is the diff(float) since I couldn't find it in your code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.