Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: DATEDIFF on different rows

    WOW..this is a beauty and it's getting me a lot closer, but for some of the EMPIDs, I'm missing some records....for instance...

    For the following

    EMPID          START_DATE                          END_DATE

    301626         2007-01-05 02:15:00.000         2007-01-05 06:49:00.000

    301626        ...

  • RE: DATEDIFF on different rows

    I may be adding steps to this that are unnecessary.....

    The original table

    EMPID          START DATE TIME               END DATE TIME

    10               01/01/2006                         01/04/2006 

    10               01/07/2006                         01/08/2006

    10               01/09/2006                         01/10/2006

    10               01/11/2006                         01/12/2006

    20               01/01/2006                         01/04/2006 

    20               01/07/2006                        ...

  • RE: DATEDIFF on different rows

    I meant to say the 5th row I would NOT want to select b/c the value of 24 is 6 more than its previous row 18 (not 3 or less).

  • RE: DATEDIFF on different rows

    Sorry for the confusion...

    I need to select rows in this table where for each EMPID the span in the value of the difference column is 3 or less.

    For instance, for...

  • RE: DATEDIFF on different rows

    Beautiful...thanks, works nicely.

    I need to take it a step further.

    I have the following table

    EMPID                  DIFF

    1                         0

    1                         20

     

    10                       0

    10                       1

    10                       16

    10                       18

    10                       24

     

    30                       0

    30                       16

     

    40                        0

    40                        3

    40                        7

    40                        8

    OK..for each unique EMPID...

Viewing 5 posts - 1 through 5 (of 5 total)