Forum Replies Created

Viewing 15 posts - 2,356 through 2,370 (of 4,085 total)

  • RE: delete a row in t-sql using inner join with other table

    Why did you change the first WHERE to an AND rather than changing the second? For INNER JOINs, it is best for legibility to clearly separate your matching conditions...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to optimize my current sql query without using a sub query

    I had to make some assumptions, and those assumptions may not be valid. I've noted those in the comments of the code.

    First, you need to be consistent in your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Attempting to change databases using cursor loop, but database won't change

    When using dynamic SQL, you have to be aware of the scope. You're changing the database inside your dynamic SQL, and that change is limited to the scope of...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    BrainDonor (9/20/2016)


    New t-shirt for dress-down Fridays - https://www.amazon.com/Trend-Could-Thinking-Would-Great/dp/B01M0TJS26

    But I don't know if I can - shouldn't the first full-stop be a comma? I think it would read better and it...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to optimize my current sql query without using a sub query

    One thing is that your second subquery does not have an ordered specified, so the order is non-deterministic.

    The other thing is that your subqueries are not obviously the same. ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Group Concatenate Strings?

    mister.magoo (9/20/2016)


    I guess we should handle NULLs as requested...

    Actually, the FOR XML PATH already handles NULLs, so you don't need to make any changes to your original code.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Date Time Issue

    SQLPain (9/19/2016)


    I am converting getdate to varchar but not converting L.fundingDate to varchar, would that miss out any dates. converting both to varchar is not giving me the accurate results...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Convert time from one format to another

    Alan.B (9/19/2016)


    drew.allen (9/19/2016)


    JALLYKAMOZE (9/19/2016)


    i need to convert a time format to another format

    eg. if the time format is 6, how can i convert it to 0600

    please assist

    TIME data DOES...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Convert time from one format to another

    JALLYKAMOZE (9/19/2016)


    i need to convert a time format to another format

    eg. if the time format is 6, how can i convert it to 0600

    please assist

    TIME data DOES NOT HAVE...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Getting rid of cursors

    It seems that your sample code is missing a comma. I assume that you want to display the Holder and the HQuantity instead of aliasing the Holder AS HQuantity.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using "Update" or "Merge" on 2014 SQL table

    The actions UPDATE, INSERT, and DELETE refer to the rows in the table, not the table itself. If the row doesn't already exist within a table, you cannot update...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Getting rid of cursors

    Your sample data is simply too sparse. What happens when a person has multiple transactions? We can't tell, because you've only provided one transaction per person. What...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: CASE Statements.....

    tmiller 90290 (9/16/2016)


    Jacob Wilkins (9/16/2016)


    Seems like you have time components in the columns you're comparing.

    You're wanting it to just compare the date portion, but it's going to compare the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: CASE Statements.....

    tmiller 90290 (9/16/2016)


    Got it and I see that now.

    Ok, so last bump is:

    Two dates are the same (=) then it should be "NEW", then the dates do not...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to return specific rows from a query

    There is a cheat if you only want to return the first row within each partition, but it uses an additional sort, so it's actually more expensive than using the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,356 through 2,370 (of 4,085 total)