Skip to main content
Commonmark migration
Source Link

#Microsoft SQL Server, 57 Bytes

Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

The Upper function is required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t

#Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

The Upper function is required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t

Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

The Upper function is required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t

Microsoft#Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

UpperThe Upper function is required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t

Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

Upper function required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t

#Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

The Upper function is required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t
Source Link
N.Y
  • 21
  • 1

Microsoft SQL Server, 57 Bytes

SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

Upper function required as format does not produce Upper case months as would be expected with the MMM format pattern.

Usage:

drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');    

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t