homer.favenir
Verified User
hi to all,
can anyone please tell me how to separate 1 field and make it to 2 fields.
i have break_hours field, and time_end field.
i need to compute the sum of break_hours if time_end <= '16:00', for field1,
and i need to compute the sum of break_hours if time_end > '16:00' for field2,
so i have 2 fields from 1 field.
is this correct? cause it doesnt work.
please advice.
thanks
can anyone please tell me how to separate 1 field and make it to 2 fields.
i have break_hours field, and time_end field.
i need to compute the sum of break_hours if time_end <= '16:00', for field1,
and i need to compute the sum of break_hours if time_end > '16:00' for field2,
so i have 2 fields from 1 field.
Code:
select
`Date`,
last_name,
(sum(break_hours) where time_end <= '16:00') as 'field1',
(sum(break_hours) where time_end > '16:00') as 'field2'
FROM
coding_log
Group By
`Date`,
Last_Name
please advice.
thanks