AndrewD04

New Member
Joined
Aug 24, 2017
Messages
40
Office Version
  1. 365
Hi, I am trying to use SQL to take all the data from my Table and summarise it on Week ID and Tier one can someone help please.

This is whati am currently using but it gives all data and i want it to summarise all under Week ID and Tier 1 only how many occur underTier 1 by week.

Declare @StartDate DATETIME
Declare @EndDate DATETIME


SET @StartDate = CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, GETDATE()-35)))
SET @EndDate = CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, GETDATE()+1 )))


SELECT
[Number]
,[CTier1]
,[CTier2]
,[Driver1]
,[Driver2]
,[PriTier]
,[Tier1]
,[Tier2]
,[Tier3]
,[Tier4]
,[CLDirection]
,[CLOutcome]
,[Comments]
,[Outcome]
,[RCause]
,[SubDate]
,[SubTime]
,[UID]
,[UName]
,[WeekNo]
,[WeekID]
,[LogDuration]
,[ContactNum]
FROM [CSCallLogger].[dbo].[tbl_Logs]
where [SubmittedDate] between @startdate and @enddate
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,214,613
Messages
6,120,515
Members
448,968
Latest member
Ajax40

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top