sql - MySQL Select First Day of Year and Month -


how find first day of year in select?

select `date`,`somevalue1`,`somevalue2` `sometablename` (`date` >= [...first day of year in date format...]) 

i found month - don't quite have grasp enough year: (i looking separate query find data between beginning of month , now)

where (`date` between  date_format(now() ,'%y-%m-01') , now() )  

i think need:

where (`date` between  date_format(now() ,'%y-01-01') , now() )  

to honest, do:

where (`date` between  date_format(now() ,'%y') , now() )  

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -