Quantcast
Channel: Help in Transpose format result
Viewing all articles
Browse latest Browse all 7

Help in Transpose format result

$
0
0

Hello- How I can get the following desired output with the 12 columns of months.

Format: lastname,firstname - DD

drop table #temp
Create table #temp (ECode char(20), lastName char(20), FirstName char(20), Bdate datetime)
Insert into #temp values ('12','Samad','Irhad','1967-01-10')
Insert into #temp values ('34','Smith','Peter','1968-01-20')
Insert into #temp values ('99','Farhan','Ji','1989-02-19')
Insert into #temp values ('44','Jina','Farah','1997-03-05')
Insert into #temp values ('41','David','Bhi','1997-06-05')
Insert into #temp values ('53','Sam','David','1972-07-01')
Insert into #temp values ('17','Kila','Sam','1972-04-01')
Insert into #temp values ('19','Sarah','G','1996-05-08')
Insert into #temp values ('67','Jinnah','F','1996-08-08')
Insert into #temp values ('41','Rose','D','1995-09-05')
Insert into #temp values ('53','Sam','T','1975-10-01')
Insert into #temp values ('67','Joe','G','1997-10-08')
Insert into #temp values ('53','Piya','SW','1962-12-01')
Insert into #temp values ('67','Bhani','Q','1992-12-07')
Insert into #temp values ('41','Mira','Dr','1987-11-05')

--Desired Output




Viewing all articles
Browse latest Browse all 7

Trending Articles