I want to select getdate() in the format yyyy/M. i tried to write a query as SELECT FORMAT(GETDATE(),'yyyy/M') but it is giving me error.I am a beginner in sql. how do i achieve yyyy/m format if there is only single digit month. eg. the query should give 2016/1 when there is only one digit month(it should not give 2016/01) and should give 2016/10 when the month is of two digits
Aucun commentaire:
Enregistrer un commentaire