troubleshooting Question

SQL Query - Historical Data

Avatar of bezellvi
bezellvi asked on
Microsoft SQL Server 2008SQL
4 Comments1 Solution100 ViewsLast Modified:
I have a SQL table with historical data on users of a specific system. I need to report on how one field has changed over time. Here's an example of the data:

User      Type      Effective Date
User 1      A      1/1/2010
User 1      B      5/1/2010
User 1      A      7/1/2010
User 2      B      1/1/2010
User 2      A      2/1/2010

The data basically means that User 1 was type A from 1/1 - 4/30, type B from 5/1 - 6/30 and back to type A from 7/1 through today.

How can I write a query that expands this data so I can chart the change of user types over time?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros