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

java - Null response to php query in android, even though php works properly -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -