Welcome Guest, Not a member yet? Register   Sign In
How to show date rows equals current date?
#18

PHP Code:
select count(employee_id) as count
from 
(select employee_id,year,month
 
     case when LOCATE('-',multiple) > 0 then substring(multiple,1,locate('-',multiple) - 1)
 
     else multiple end as 1st_date
      case when LOCATE
('-',multiple) > 0 then substring(multiple,locate('-',multiple) + 1,length(multiple) - locate('-',multiple))
 
     else multiple end as 2nd_date
from ats_leave_apps
)
where DATE(concat(year,'-',month,'-',1st_date)) >= CURDATE() and DATE(concat(year,'-',month,'-',2nd_date)) <= CURDATE()
 
LIMIT 025 
MySQL said
Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'case when LOCATE('-',multiple) > 0 then substring(multiple,locate('-',multiple) ' at line 5 

MySQL Version: 5.0.11
Reply


Messages In This Thread
RE: How to show date rows equals current date? - by jelz2018 - 03-06-2019, 08:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB