astrid 69000 - Tuesday, February 6, 2018 11:22 AM
You're on the right track for days in a quarter and days in a year, but you need to use the first day in a quarter/year for the comparison. You've already been pointed to a website of useful date functions which includes finding the first day in a period.
Weeks in a quarter is more problematic, because week could be defined several different ways, and each of those ways would have a slightly different coding. For instance, what day does your week start? How do you want to handle quarters that start/end in the middle of the week?
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA