Get year and month from SQL

后端 未结 3 770
小鲜肉
小鲜肉 2020-12-22 05:14

I want to know how can I get the year and month into my database. For example, suppose it’s August, 2011. The output that I need is like this: CAB 11 08 001 (CA

3条回答
  •  情话喂你
    2020-12-22 05:39

    Using your method \ logic..

    Right('0' + Cast(Month(GetDate()) as varchar(10)),2)
    

提交回复
热议问题