• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

adding to fields together

I have this part of code with provides hrs and minutes for two columns

but i now need to add another colunm which is the total of the two fields

so today i have
hrmins      bHrMin
6:45              0:30
0:45              0:00
6:00              0:30
5:00              0:30

i would like

hrmins      bHrMin   TotalMins
6:45              0:30         6:15
0:45              0:00         0.45
6:00              0:30         5.30
5:00              0:30         4.30
 
FLOOR((charge_split_1.duration + 1) / 60.0)) + ':' + RIGHT('0' + CONVERT(varchar, (charge_split_1.duration + 1) % 60), 2) AS hrmins, CONVERT(varchar, 
                      FLOOR(charge_split_1.break_time / 60.0)) + ':' + RIGHT('0' + CONVERT(varchar, charge_split_1.break_time % 60), 2) AS bHrMin,

Open in new window

0
James Murrell
Asked:
James Murrell
  • 2
1 Solution
 
James MurrellProduct SpecialistAuthor Commented:
went a bit brain dead, answer was simple

(charge_split_1.duration + 1- charge_split_1.break_time)/60.0 as  newtotal
0
 
James MurrellProduct SpecialistAuthor Commented:
solution provided
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now