Forum Replies Created

Viewing 15 posts - 1,906 through 1,920 (of 4,085 total)

  • RE: How can I prevent a record from appearing based on two columns

    drew.allen - Tuesday, January 31, 2017 9:39 AM

    bgalway - Tuesday, January 31, 2017 7:13 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Best way to randomly select rows?

    chef423 - Thursday, February 2, 2017 1:31 PM

    I already have a table called Transactions   ???

    Shoudlnt that be a temp table...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Grouping by date hour with "buckets"

    Joe Torre - Thursday, February 2, 2017 1:19 PM

    Try something like:

    SELECT
          CASE
             WHEN i.Duration BETWEEN '0:00:00' AND '1:00:00' THEN...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: DUPLICATING A ROW BY NUMBER OF OCCURENCE OF A PARTICULAR FIELD IN ANOTHER TABLE

    JALLY - Thursday, February 2, 2017 12:53 PM

    Thanks everyone,

    I figured it out and used a while loop in a cursor.

    Thanks

    Cursors tend to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Best way to randomly select rows?

    Eric M Russell - Thursday, February 2, 2017 1:02 PM

    I'll admit I don't resort to using CTEs often. I thought the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: join query bringing back null values

    Your join is on PS.ProjectSafeguardID = S.SafeguardID, but your select is on S.ProjectSafeguardID.  Change your join to PS.ProjectSafeguardID = S.ProjectSafeguardID.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Best way to randomly select rows?

    Eric M Russell - Wednesday, February 1, 2017 11:36 AM

    OK, the following will:
    - create a sample table similar to what...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    ZZartin - Thursday, February 2, 2017 9:07 AM

    Ed Wagner - Thursday, February 2, 2017 8:28 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Sort by or statement

    Because of the GROUP BY, you cannot reference the Keyword field directly in your ORDER BY.  This should work.

    SELECT A.ImgName, A.ImgID
     FROM Images A

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How can I make my stored procedure more efficient?

    First, when posting code it REALLY helps if you use the SQL Code button to format your code.

    You're using unnecessary WHILE loops.  Get rid of them.  The first...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Importing data using bcp

    The documentation has an example on how to create a format file.  You'll also need to use the -t option to change the delimiter to a pipe (from the default...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Best way to randomly select rows?

    Eric M Russell - Wednesday, February 1, 2017 9:57 AM

    You can easily select rows in random order like so. However, I'm not...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Importing data using bcp

    The documentation on BCP is very good and BCP contains too many options for us to give you an intelligent response with so little information.  I suggest that you Google...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: dynamic moving date ranges

    I believe that this will work.

    ;
    WITH event_pvt AS
    (
        SELECT t.eventdate, e.is_start,
            CASE
                WHEN e.is_start = 0 THEN 'N'
                WHEN LAG(e.is_start, 1, 0) OVER(ORDER BY...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: DUPLICATING A ROW BY NUMBER OF OCCURENCE OF A PARTICULAR FIELD IN ANOTHER TABLE

    The join will give you exactly what you asked for.  If it's not giving the results that you expect, we can't help you without more information.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 1,906 through 1,920 (of 4,085 total)