Forum Replies Created

Viewing 7 posts - 1 through 8 (of 8 total)

  • RE: TSQL Dynamic columns and SUM at the end

    After whole day of experimenting in sql, I found some partial solution, but my sum isn't good. I used COUNT(*) over partition:

    DECLARE

    @cols AS NVARCHAR(MAX),

    ...

  • RE: TSQL Dynamic columns and SUM at the end

    Thanks J Livingston!

    I think that Employee table is not necessary but here it is preety much a whole db 🙂

    Thanks!

  • RE: TSQL Dynamic columns and SUM at the end

    For some reason, when I Post a reply, it gone away.

    Please find this dropbox link:

    Thanks!

  • RE: TSQL Dynamic columns and SUM at the end

    Of course! Sorry!

    USE [SalesManagement]

    GO

    /****** Object: Table [dbo].[AdeccoView] Script Date: 20/03/2016 1:33:40 PM ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[AdeccoView](

    [ViewID] [int] IDENTITY(1,1) NOT NULL,

    [Date] [date] NOT NULL,

    [ClientID]...

  • RE: TSQL Dynamic columns and SUM at the end

    Of course! Sorry!

    USE [SalesManagement]

    GO

    /****** Object: Table [dbo].[AdeccoView] Script Date: 20/03/2016 1:33:40 PM ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[AdeccoView](

    [ViewID] [int] IDENTITY(1,1) NOT NULL,

    [Date] [date] NOT NULL,

    [ClientID]...

  • RE: TSQL Dynamic columns and SUM at the end

    Of course! Sorry!

    USE [SalesManagement]

    GO

    /****** Object: Table [dbo].[AdeccoView] Script Date: 20/03/2016 1:33:40 PM ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[AdeccoView](

    [ViewID] [int] IDENTITY(1,1) NOT NULL,

    [Date] [date] NOT...

  • RE: TSQL Dynamic columns and SUM at the end

    USE [SalesManagement]

    GO

    /****** Object: Table [dbo].[AdeccoView] Script Date: 20/03/2016 11:53:27 AM ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[AdeccoView](

    [ViewID] [int] IDENTITY(1,1) NOT NULL,

    [Date] [date] NOT NULL,

    [ClientID] [int] NOT...

Viewing 7 posts - 1 through 8 (of 8 total)