troubleshooting Question

Format a result from several rowns into one

Avatar of Peter Nordberg
Peter NordbergFlag for Sweden asked on
* T-SQLMicrosoft SQL Server
2 Comments1 Solution97 ViewsLast Modified:

I have this query looking like this:
SELECT * FROM dbo.EmployeeWorkTimeSchedule AS ewts WHERE EmployeeID = 2514 AND MONTH(ewts.fromDate) = 12

And giving the following result:
How can I make a query so that the rusult will be formatted like this?
2018-12-01   Pass 1: 8:00-12:00 | Lunch: 12:00 - 13:00 | Pass 2: 13:00-17:00
2018-12-02   Pass 1: 8:00-12:00 | Lunch: 12:00 - 13:00 | Pass 2: 13:00-17:00

Thanks for help!

Senior Developer

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 2 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 2 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