Forum Replies Created

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

  • RE: Date Addition

    Thanls for the resource. This is what I came up based on it.

    Select s.DateOfRange, s.SignedCount,r.ResignationsCount,n.NetSignedCount,

    (

    SELECT SUM(n2.NetSignedCount)

    ...

  • RE: Date Addition

    I went with the seperate temp tables and did a inner join to link them all together in a single record set. But I have one last issue:

    Select t1.DateOfRange, t1.SignedCount...

  • RE: Date Addition

    If I have to use multiple temp tables, how would I join them together in order to get one flat recordset back?

  • RE: Date Addition

    ;with

    SCount as

    (SELECT d.DateValue AS DateofRange , Count(Distinct c.ConsultantID) AS SignedCount

    FROM #DateList d LEFT JOIN Consultant c ON d.DateValue=c.NACDate

    WHERE d.DateValue between @StartDate and @ENdDate

    ...

  • RE: Date Addition

    I am not sure that gives me what I want. The records set needs to be 'flat'. When I use the UNION ALL it just returns everything in two columns...

  • RE: Date Addition

    I think I need to UNion them because the final reslut set should be some like

    DateOfRange, SignedCount(1st script), ResigniationCount (2nd script)

  • RE: Date Addition

    This has been working base on the #DateList table (thanks) but what how would I combined the following two recordsets into a single record set:

    SELECT d.DateValue AS DateofRange , Count(Distinct...

  • RE: Date Addition

    Cool that worked perfectly.

  • RE: Date Addition

    I find this interesting:

    When I run this based on my date table:

    SELECT d.DateValue AS DateofRange , Count(c.NacDate) AS SignedCount

    FROM #DateList d LEFT JOIN Consultant c ON d.DateValue=c.NACDate

    WHERE d.DateValue between @StartDate...

  • RE: Date Addition

    I was thinking along the lines of creating a temp table to hold the dates generated by the date range and then join to it as I need it. But...

  • RE: Single row from MAX

    THis worked great. Thanks a lot.

  • RE: Get rid of Dynamic SQL

    Yes, I looked but they really didn't seem to fit what I was after. I understand the CASE statements but that not how the proc works.

  • RE: Get rid of Dynamic SQL

    I would really appreciate a example. THe Shearch critertia is broke done into 3 section:

    Criteria 1: Amount Filters

    Criteria 2: Line Filters

    Criteria 3: Status Filters

    Each of these filters are used to...

  • RE: MAX Function is not working correctly

    Any ideas on this issue?

  • RE: MAX Function is not working correctly

    I ran into a small issue. In one case I am returning 2 rows where it shoould only be a single: Code:

    Select c.ConsultantID,

    ...

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