Skip to content Skip to sidebar Skip to footer

Querying For "workweek" In Access Sql

I have a formula from MS Excel 2007 which returns the workweek of a certain date within a certain month. B1 = IF(AND(WEEKDAY(A2,1)<>1,A2=DATE(YEAR(A2),MONTH(A2),1)),A2-WEEKDA

Solution 1:

Don't calculate, query. See:

Why should I consider using an auxiliary calendar table?

A calendar table can make it much easier to develop solutions around any business model which involves dates. Last I checked, this encompasses pretty much any business model you can think of, to some degree. Constant problems that end up requiring verbose, complicated and inefficient methods include the following questions:

  • How many business days between x and y?
  • What are all of the dates between the second Tuesday of March and the first Friday in April? 
  • On what date should I expect this shipment to arrive? 
  • What were the dates of all the Fridays in this quarter? 
  • ...  

Post a Comment for "Querying For "workweek" In Access Sql"