Forum Replies Created

Viewing 15 posts - 226 through 240 (of 844 total)

  • Reply To: Are the posted questions getting worse?

    When I came back to work Monday I was initially excited to see we were on the new version of SSC.  My excitement quickly faded.

    I read Steve's article the other...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • Reply To: Today's Random Word!

    Lanes

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    kdrymer - Wednesday, March 27, 2019 1:01 PM

    Works beautifully!!! Think it was an issue with the grouping. Thanks very much!

    Your Group...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Today's Random Word!

    Ed Wagner - Wednesday, March 27, 2019 11:42 AM

    Ray K -...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Recursive CTE Duplication

    A definition and test data for businessunitbase would be helpful.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Recursive CTE Duplication

    Couldn't you just left join the table businessunitbase to itself?

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    Lynn Pettis - Tuesday, March 26, 2019 3:27 PM

    I also believe that each column of a SELECT should be on its...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    I see Lynn, but I'll take my chances for now.
    WITH CTE AS
      (SELECT A.BUSINESS_UNIT, A.PO_ID, A.PO_TYPE, A.PO_STATUS,
       (CONVERT(CHAR(10),A.PO_DT,121)) AS PO_DT,
      ...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    Lynn Pettis - Tuesday, March 26, 2019 2:28 PM

    I reformatted your original code like this:

    WITH [CTE]
    AS
    (
    SELECT
      [A].[BUSINESS_UNIT]
    ...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    I modified the SQL I posted, I didn't want to take the time to reformat your last post.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    With out test data it's hard to say, but try this: (ALWAYS post your code within the SQL code tags)  I removed a bunch of columns in your group by...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Problem using CTE

    wegrob - Monday, March 25, 2019 3:02 PM

    Yes, I do have the FROM in the CTE, just didn't get it in here.

    I...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: CTE Group By not grouping results correctly

    Looking at your results from (Alias 'CTE') the reason you are not getting one row per requestor is the 'Line_NBR' column.
    It doesn't look like you are using that field...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Problem using CTE

    Cast Sequence# as a char and don't convert member# to an int to get around this. At least that's what I would do.  There is no FROM in your CTE,...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Are the posted questions getting worse?

    Jonathan AC Roberts - Friday, March 22, 2019 11:58 AM

    below86 - Friday, March 22, 2019 11:10 AM

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

Viewing 15 posts - 226 through 240 (of 844 total)