mardi 2 juin 2020

How do I count between 2 rows in the same column only if there are some specific values in another column

 SELECT (COUNT (*))
 FROM Calendar
 WHERE (IdCalendar >= 20190916  AND IdCalendar <= 20191031)
 CASE WHEN (DayoftheWeek = 'Monday' 
 CASE WHEN (DayoftheWeek = 'Tuesday'
 CASE WHEN (DayoftheWeek = 'Wednesday'
 CASE WHEN (DayoftheWeek = 'Thursday'
 CASE WHEN (DayoftheWeek = 'Friday'

Basically, how do I get the count between those 2 dates only when the days of the week are weekdays. Because if only do the count between those 2 dates is going to include weekends.

Aucun commentaire:

Enregistrer un commentaire