Forum Replies Created

Viewing 15 posts - 736 through 750 (of 1,402 total)

  • Reply To: Update Column Based on Criteria from Other Columns -- improved post included DDL

    Ugh it's dependent on calculated row values.  Although painful to create, here's a WHILE loop which populates a new table '#myNewTable' with the ID and the derived theoretical_cycle column.  It's...

  • Reply To: Update Column Based on Criteria from Other Columns -- improved post included DDL

    Does it also restart at 0 when aggregating the days?

  • Reply To: Update Column Based on Criteria from Other Columns -- improved post included DDL

    The 'max_val' column matches the 'Days_Cycle' column in the table provided.  The 'theoritical_cycle' (in rows where ID is greater than 19) doesn't seem to follow the rules you're suggesting

  • Reply To: Update Column Based on Criteria from Other Columns -- improved post included DDL

    Integer division comes in handy when creating groupings based on ranges of integers,  aka "buckets".  Something like this

    select t.*, v.*, cycle.*
    from #mytable t
    ...
  • Reply To: Filling in Empty Rows

    Well well, this is the first time I can recall ever using a RIGHT JOIN in a "real" query.  It seems to make sense here.

    declare @dt ...
  • Viewing 15 posts - 736 through 750 (of 1,402 total)