samedi 27 janvier 2018

Mysql I want to add this two if statement heres the code that i've tried

Hello can you help me out . here's the code i've tried. CREATE VIEW view_hrsworkpersched2 AS select tt.sched_id AS sched_id,tt.date AS date,sec_to_time(case when (tt.time_in >= s.time_from) then sum(time_to_sec(tt.time_out) - time_to_sec(tt.time_in)) end + case WHEN (tt.time_in < s.time_from AND tt.time_out > s.time_from) THEN time_to_sec(tt.time_out) - time_to_sec(s.time_from) ELSE 00 end) AS hrswork from (tbl_timelogs_temp tt join tbl_schedule s) where (tt.sched_id = s.sched_id) group by tt.sched_id,tt.date

. What I want is that when this two condition (tt.time_in >= s.time_from),(tt.time_in < s.time_from AND tt.time_out > s.time_from) met its condition then they will add

Aucun commentaire:

Enregistrer un commentaire