troubleshooting Question

TSQL - query syntax

Avatar of soozh
soozhFlag for Sweden asked on
Microsoft SQL Server 2008SQL
4 Comments2 Solutions309 ViewsLast Modified:
I have a table that contains patient visit data for a number of patients.

The important column is the VisitDate column.

I need to now produce a crosstab showing the total counts of patient visits on a daily basis.

In the cross tab i need to include the dates where there are no visits.  So basically 30(31) columns for a months data.

I think that i need to create a table with the possible dates and then somehow join them with the table PatientVisits using the VisitDate column.

Any ideas?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 4 Comments.
Join the Community
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 2 Answers 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