mysql - How to use html type="date" for count in sql for number of student enrolled in a year? -


i have problem on how count number of students in year enroll?

my "datefilled" html type="date"

'select datefilled, count(datefilled) number_of_enrolled studentinformation group datefilled' 

but problem cant count year total of student

i assume date format html input type=date yyyy-mm-dd. regardless if database field type datetime or varchar, can use function year() plus group by aggregate records statement:

select year(datefilled) year, count(datefilled) number_of_enrolled  studentinformation group year(datefilled); 

enter image description here


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -