Forum Replies Created

Viewing 15 posts - 31 through 45 (of 84 total)

  • RE: Executing same SQL code twice

    Jonathan AC Roberts - Friday, August 24, 2018 5:51 AM

    Instead of making it a Stored Procedure you could make it a Table...

  • RE: Calculate percent change between columns

    Jonathan AC Roberts - Friday, August 24, 2018 4:31 AM

    NikosV - Friday, August 24, 2018 4:08 AM

  • RE: Calculate percent change between columns

    Yeap.


    DECLARE @DateFrom DATE = '2018-01-01';
    DECLARE @DateTo DATE = '2018-08-21';

    IF OBJECT_ID('tempdb..#ClaimType') IS NOT NULL
    DROP TABLE #ClaimType

    CREATE TABLE #ClaimType
    (
      ClaimDescription VARCHAR(255) PRIMARY KEY...

  • RE: Multiple Joins

    NikosV - Thursday, August 23, 2018 7:56 AM

    Jonathan AC Roberts - Thursday, August 23, 2018 5:06 AM

  • RE: Multiple Joins

    Thom A - Friday, August 24, 2018 1:34 AM

    NikosV - Thursday, August 23, 2018 11:28 PM

    August 24, 2018 at 1:49 am

    #2003157

  • RE: Multiple Joins

    Quick question, what does CASE WHEN THEN 1 mean? What's the THEN 1 doing exactly?

  • RE: Multiple Joins

    Jonathan AC Roberts - Thursday, August 23, 2018 5:06 AM

    NikosV - Thursday, August 23, 2018 2:34 AM

  • RE: Multiple Joins

    Thom A - Thursday, August 23, 2018 3:05 AM

    I can't see any sample data in your SQL, only DDL definitions. I'll need...

  • RE: Multiple Joins

    Claim Main Table Sample


    CREATE TABLE [Schema.ClaimMain]
    (
     [PolicyNumber] [int] NULL,
     [ClaimNumber] [int] NOT NULL,
     [ClaimType] [smallint] NOT NULL,
     [CurrentStatus] [smallint] NOT NULL,
     [OpeningRegistrationDate] [datetime] NOT...

  • RE: Multiple Joins

    Thom A - Thursday, August 23, 2018 1:56 AM

    YOu really need to get away from using a subquery for EVERY expression (I.e....

  • RE: Multiple Joins

    Hi Thom.

    I've changed the code to this.


    DECLARE @DateFrom DATE = '2018-01-01';
    DECLARE @DateTo DATE = '2018-08-21';

    SELECT GenPar.ParameterValue AS ClaimType,
           COUNT(CASE ClaimMain.CurrentStatus...

  • RE: Multiple Joins

    Thom A - Wednesday, August 22, 2018 7:53 AM

    NikosV - Wednesday, August 22, 2018 7:46 AM

    August 22, 2018 at 7:59 am

    #2002841

  • RE: Multiple Joins

    NikosV - Tuesday, August 21, 2018 4:01 AM

    Thom A - Tuesday, August 21, 2018 3:39 AM

    August 22, 2018 at 7:46 am

    #2002837

  • RE: Best way to join onto same table to extract different data

    Mike01 - Tuesday, August 21, 2018 9:37 AM

    This still doesn't help.  We don't have any information about Company.Schema.GeneralParameter, Company.Schema.ClaimMain,  Company.Schema.PolicyCover or any other table. ...

  • RE: Best way to join onto same table to extract different data

    drew.allen - Tuesday, August 21, 2018 9:41 AM

    Please don't start multiple threads for essentially the same question.  You were already told in...

Viewing 15 posts - 31 through 45 (of 84 total)