Click here to Skip to main content
15,919,028 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Asp.Net MVC Delete Method Not Allowed Pin
Richard Deeming7-Feb-19 0:44
mveRichard Deeming7-Feb-19 0:44 
GeneralRe: Asp.Net MVC Delete Method Not Allowed Pin
Kevin Marois7-Feb-19 8:35
professionalKevin Marois7-Feb-19 8:35 
QuestionASP.NET CORE AUTHENTICATION AGAINST ADFS Pin
_dk66072-Feb-19 6:18
_dk66072-Feb-19 6:18 
AnswerRe: ASP.NET CORE AUTHENTICATION AGAINST ADFS Pin
Mycroft Holmes2-Feb-19 13:33
professionalMycroft Holmes2-Feb-19 13:33 
GeneralRe: ASP.NET CORE AUTHENTICATION AGAINST ADFS Pin
_dk66073-Feb-19 2:52
_dk66073-Feb-19 2:52 
AnswerRe: ASP.NET CORE AUTHENTICATION AGAINST ADFS Pin
Kornfeld Eliyahu Peter3-Feb-19 3:38
professionalKornfeld Eliyahu Peter3-Feb-19 3:38 
QuestionDiscussion - MVC vs Core Razor Pages (Core 2.1) and other CRaP stuff Pin
#realJSOP28-Jan-19 3:51
professional#realJSOP28-Jan-19 3:51 
AnswerRe: Discussion - MVC vs Core Razor Pages (Core 2.1) and other CRaP stuff Pin
Richard Deeming28-Jan-19 6:19
mveRichard Deeming28-Jan-19 6:19 
GeneralRe: Discussion - MVC vs Core Razor Pages (Core 2.1) and other CRaP stuff Pin
#realJSOP28-Jan-19 7:27
professional#realJSOP28-Jan-19 7:27 
QuestionCore 2.1 Razor Pages Solution Pin
#realJSOP22-Jan-19 1:52
professional#realJSOP22-Jan-19 1:52 
QuestionBS Carousel local images Pin
Member 1097549721-Jan-19 7:46
Member 1097549721-Jan-19 7:46 
AnswerRe: BS Carousel local images Pin
Pete O'Hanlon22-Jan-19 2:03
mvePete O'Hanlon22-Jan-19 2:03 
GeneralRe: BS Carousel local images Pin
Member 1097549723-Jan-19 8:55
Member 1097549723-Jan-19 8:55 
QuestionCreating a 'design your own' feature on my website Pin
Member 1411577011-Jan-19 17:27
Member 1411577011-Jan-19 17:27 
AnswerRe: Creating a 'design your own' feature on my website Pin
Nathan Minier16-Jan-19 1:45
professionalNathan Minier16-Jan-19 1:45 
QuestionCreating PIVOT data not producing correct result Pin
samflex10-Jan-19 20:31
samflex10-Jan-19 20:31 
Greetings,

I am attempting to create PIVOT data where amountPaid is displayed under registration_Date as in the following format
:
2018 2019, etc
300.00 160.00. etc

So far, the result is not coming out right.
Instead of the amountPaid displaying on the year colums, reg_fee amount is displaying on the first column.

This is driving me nuts.

I am creating the pivot data dynamically. This way, any new year created is displayed with amountPaid as the value.

This is the code I am using:

ALTER PROCEDURE [dbo].[uspGetPivotedData]
AS
DECLARE @cols AS NVARCHAR(MAX),
    @query  AS NVARCHAR(MAX);
SET @cols = STUFF((SELECT distinct ',' + QUOTENAME(m.registration_date) 
            FROM Members m
            FOR XML PATH(''), TYPE
            ).value('.', 'NVARCHAR(MAX)') 
        ,1,1,'')
set @query = 'SELECT TransactionID,
                AmountOwed,
				FullName,
				Gender,
				phone,
				EmailAddress,
				Address,
				EventYear, 
                Description,
				Reg_Fee
				 ' + @cols + ' from 
               (
                SELECT t.TransactionID, 
					 t.AmountOwed,
					 m.FullName,
                     m.EmailAddress,
					 m.Gender, 
					 m.Phone, 
                     m.Address,
				     t.EventYear, 
                     p.Description,					
					 Reg_Fee,
                     m.registration_date,
					 t.AmountPaid
                     from dbo.Transactions AS t INNER JOIN dbo.Members AS m ON t .MemberID = m.MemberID INNER JOIN
                     dbo.PaymentTypes AS p ON t .TypeID = p.PaymentTypeID
          ) x
            pivot 
            (
                max(AmountPaid)
                for registration_date in (' + @cols + ')
            ) p '
            EXECUTE sp_executesql @query


registration_date is of int data type.

Any ideas what I am doing wrong?
AnswerRe: Creating PIVOT data not producing correct result Pin
Richard Deeming11-Jan-19 2:01
mveRichard Deeming11-Jan-19 2:01 
General(Solved) Re: Creating PIVOT data not producing correct result Pin
samflex11-Jan-19 4:14
samflex11-Jan-19 4:14 
QuestionObject Type and HTTP JSON Gets Pin
cjb1107-Jan-19 22:04
cjb1107-Jan-19 22:04 
QuestionWordpress Website Showing Error Pin
Jack_Calder5-Jan-19 0:48
professionalJack_Calder5-Jan-19 0:48 
AnswerRe: Wordpress Website Showing Error Pin
Afzaal Ahmad Zeeshan5-Jan-19 1:51
professionalAfzaal Ahmad Zeeshan5-Jan-19 1:51 
Questiontransform: skew only on one side [SOLVED] Pin
Valentinor17-Dec-18 2:49
Valentinor17-Dec-18 2:49 
AnswerRe: transform: skew only on one side Pin
Valentinor17-Dec-18 5:40
Valentinor17-Dec-18 5:40 
GeneralRe: transform: skew only on one side Pin
Richard Deeming17-Dec-18 9:26
mveRichard Deeming17-Dec-18 9:26 
GeneralRe: transform: skew only on one side Pin
Valentinor17-Dec-18 11:02
Valentinor17-Dec-18 11:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.