Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

I can't work out this query

$
0
0

I need to generate a report where I simplify (consolidate) work Schedules. The current table is One Line = One Week, where the schedule shows 0 for day scheduled to work and 1 for a day scheduled off. What I need is one line for an arbitrary number of weeks showing the first and last day of each schedule change. In other words, given this:

I need a query that will give me this:

I cannot for life of me get this. Can it be done?


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>