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

SQL Query Help - Columns Based Upon Date Week End

$
0
0

Calling SQL Server query masters! I need help with a query i am trying to accomplish. I need to build an output that counts records by dynamic columns based upon a date field in the record. The data looks like this:

classIdSourceAppt_Date
1East2/1/2019
2West2/14/2019
3North2/22/2019
4East2/23/2019
5South3/1/2019
6East3/2/2019
7West3/2/2019
8North3/7/2019
9North3/11/2019
10South3/22/2019

My desired output would be something like this:

2/2/20192/9/20192/16/20192/23/20193/2/20193/9/20193/16/20193/23/2019Total
East1113
North1113
South112
West112
Total1012311110

Grateful to any one who can help out with this one.

Viewing all articles
Browse latest Browse all 4871

Trending Articles



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