Forum Replies Created

Viewing 15 posts - 181 through 195 (of 1,468 total)

  • Reply To: startdate -1

    You are on the right track.

    SELECT t.Testid
    , t.Status
    , t.Startdate
    , EndDate = DATEADD(dd,...
  • Reply To: startdate -1

    Your expected output is inconsistent.

    That said, I believe that you need to look at the LAG function.

  • Reply To: Compare columns within the same row

    I would add a priority field and add it to the order  by.

    So, using Scott's code, it would now look like this ...

    SELECT d.ID, ca1.Amt, ca1.AmtReason
    FROM #data...
  • Reply To: Get the Suggested employee to assign ticket

    This looks like you are trying to create a catch-all query.  You are on a slippery slope.

    I have never worked with geometry data types before, but after a quick google,...

  • Reply To: Windows function : difference b/w current row and prev row of different column

    masterelaichi wrote:

    Is there a difference in using an alias using the AS keyword as opposed to what you have done here for the Prev_end and  Numday lines?

    Functionally, there is no...

  • Reply To: Windows function : difference b/w current row and prev row of different column

    In order to help us to help you, please provide data in readily consumable  format (like this)

    IF OBJECT_ID( 'TempDB..#Data', 'U' ) IS NOT NULL
    DROP TABLE...
  • Reply To: row_number dates

    You need to GROUP BY v.PatID, v.ProcValDate

    Below is an expanded data set, with options to add "RN" by both the DateTime, and just the Date

    IF OBJECT_ID( 'TempDB..#value',...
  • Reply To: performance question

    Bruin wrote:

    You are correct in assessment of the field def....a catch all... so how in CODE based upon what I supplied can it be fixed?

    Thanks.

    The only way to get rid...

    • This reply was modified 4 years, 3 months ago by DesNorton. Reason: Code blocks 2 and 3 updated
  • Viewing 15 posts - 181 through 195 (of 1,468 total)