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

(03-02-2019, 07:20 PM)php_rocs Wrote: @jelz2018,

Combining them isn't the problem.  I noticed in your example image that you had a date of 11-13, that is going to be a problem.  I do have a suggestion for the rest.  Here you go.

Assuming that you have access to MySQL directly try testing this first (to make sure it works):
   select DATE(concat(year,'-',month,'-',multiple)) as CombinedDate from ats_leave_apps

If it works (it will not work for the records that have a date range) then try this:
select COUNT(employee_id) AS count FROM ats_leave_apps WHERE DATE(concat(year,'-',month,'-',multiple)) = CURDATE()")

The next issue that you will have will be the multiple column.  You will need to determine how you wish to handle date ranges.  You can create a if condition to determine what value should represent the date.  Once you determine how you want to handle it let me know and I can probably give you a suggestion.

This is the result when I run the command.

PHP Code:
select DATE(concat(year,'-',month,'-',multiple))
MySQL saidDocumentation

#1054 - Unknown column 'year' in 'field list' 

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

Theme © iAndrew 2016 - Forum software by © MyBB