mysql - Subtract one week from current week of the year -


i trying 1 week earlier current week of year sql query returning null. here query

select date_sub(yearweek('2014-01-01'),interval 1 week) 

what wrong query

if want yearweek of week prior date, can this: note: yearweek results in 6-digit number, first 4 digits week year, trailing 2 digits week number.

select yearweek('2014-01-01' - interval 1 week) 

if need date 1 week before given date, then:

select '2014-01-01' - interval 1 week 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -