sql - how to query mysql on the current week? -


this query current day:

select count(*) blog_posts poststatus = "pending" , date(date_accepted) = curdate() 

now how if want query week? in advance..

use yearweek() function

where yearweek(date_accepted) = yearweek(now()) 

don't use week() because match weeks different years.


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -