Help in Transpose format result
What exactly do you mean? Within each month we sort by day of the birthday (but not the birthday itself which can be also added as a secondary sort to the ROW_NUMBER() function). In this case people...
View ArticleHelp in Transpose format result
Hi,The query result is perfect but when I am running in my database then DD is not being sorted. How we can use Order by DD so every column will be sorted order by DD.
View ArticleHelp in Transpose format result
Hi Jugnu,Please also have a try with below: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...
View ArticleHelp in Transpose format result
Create table #temp (ECode char(20), lastName char(20), FirstName char(20), Bdate datetime) Insert into #temp values ('12','Samad','Irhad','1967-01-10') , ('34','Smith','Peter','1968-01-20') ,...
View ArticleHelp in Transpose format result
Try;with cte as (select RTRIM(LastName) + ', ' + RTRIM(FirstName) + ' - ' + RIGHT('0' + cast(datepart(day, BDate) as varchar(2)),2) as FullNameDt, left(datename(month, BDate),3) as [Mnth], ROW_NUMBER()...
View ArticleHelp in Transpose format result
Hello- How I can get the following desired output with the 12 columns of months.Format: lastname,firstname - DDdrop table #temp Create table #temp (ECode char(20), lastName char(20), FirstName...
View Article