I am given a start and end date.
i want to count the number of weekdays between those 2 dates.
then in a table of dates, i want to count those in a similar fashion to to pick weekends only.
Could someone help me on this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One approach is to have a materialized table of days / dates. But this same method, used to build this materialized table, can be used directly in a query. I show a couple of [weekday] calculations, but you can use the same approach to query about weekend days (weekend day values are 5, and 6):
Direct single query example: