sql - How to select previous month in mysql with variable? -


this question has answer here:

$m=01 $y=2016 

given month, how find value of previous month? (in example: december 2015)

select convert(varchar,dateadd(d,-(day(getdate())),getdate()),106) 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -