Skip to content
Advertisement

How to flip a bit switch based on events in date sequence without using SQL CURSOR?

I have a list of dates, with occasional events that correspond to start and stop dates for periods, and I want to flip a bit switch for all dates which occur between start and stop.

Example:

(Obviously just a pseudocode example).

Is there a way to join these two tables without using a cursor and get the following result:

I hope this makes sense. Obviously would be easy with a cursor, but is there another way using only joins?

Thanks everyone for your time.

Advertisement

Answer

I think this will help you

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement