Date Sesson work Amount
1/11/2018 FN work1 300
2/11/2018 FN work1 350
AN work2
3/11/2018 FN work1 350
AN work2
AN work3
Code:
SELECT DATE_FORMAT(`time_stamp`,'%d-%m-%Y') as time_stamp,
case when time(time_stamp) between '01:00:00' and '12:00:00' then 'FN'
when time(time_stamp) between '12:00:00' and '24:00:00' then 'AN'
end as period, work
from table1 order by time_stamp
First, if your table field is called "wdate", why do you try to write a query that uses the field "time_stamp"?
Second, you need a value called "Amount" in your output. Where is it in your database?
(11-14-2018, 12:08 PM)Wouter60 Wrote: First, if your table field is called "wdate", why do you try to write a query that uses the field "time_stamp"?
Second, you need a value called "Amount" in your output. Where is it in your database?
1,column name changed,
2, the amount should calculated based on the count ( for ex if count(an,fn)=1, amount 300,else 350)