wheels0323
Programmer
I have this code.
select
laborlevelname2,
laborlevelname3,
personnum,
applydate,
laborlevelname4,
personfullname,
laboracctname,
timeinseconds,
Convert(VarChar(5), DateAdd(Minute, timeinseconds / 60, 0), 108) As HourMin,
wageamount,
laborleveldsc5
from vp_totals
where applydate >= '2007-01-01'
and applydate <= '2007-07-30'
and laborlevelname4 >= '00700'
and laborlevelname4 <= '00701'
and paycodename = '00 Total Worked Hours'
and laborlevelname3 > '05000'
The data it returns is showed in the attachment.
Iam creating a report to calculate total labor hours and wages for each person.
So, for a person, they might have 4 lines of data depending on how many days a person works.
Is their a way to sum their time worked(field - timeinseconds) and wages(field - wageamount). So that it shows up in one line per person. So on the picture below for Abel,Kit it returns one line with her total wages and total time worked. Yet, at the same time. The last field(laborleveldsc5), if they work in more then one department their would be two lines.
Let me know if you can help.
Thank you.
select
laborlevelname2,
laborlevelname3,
personnum,
applydate,
laborlevelname4,
personfullname,
laboracctname,
timeinseconds,
Convert(VarChar(5), DateAdd(Minute, timeinseconds / 60, 0), 108) As HourMin,
wageamount,
laborleveldsc5
from vp_totals
where applydate >= '2007-01-01'
and applydate <= '2007-07-30'
and laborlevelname4 >= '00700'
and laborlevelname4 <= '00701'
and paycodename = '00 Total Worked Hours'
and laborlevelname3 > '05000'
The data it returns is showed in the attachment.
Iam creating a report to calculate total labor hours and wages for each person.
So, for a person, they might have 4 lines of data depending on how many days a person works.
Is their a way to sum their time worked(field - timeinseconds) and wages(field - wageamount). So that it shows up in one line per person. So on the picture below for Abel,Kit it returns one line with her total wages and total time worked. Yet, at the same time. The last field(laborleveldsc5), if they work in more then one department their would be two lines.
Let me know if you can help.
Thank you.