Find Specific Date Base on a Day Number

  • Hello Expert,
    Basically my current selling session is Fall 1 2018 which has 36 selling days passed for school A and 33 for school. B. I'm trying to find the date of 36 days passed for previous session and prior year session for school A (33 day passed for school B).
    school A 36 day passed for Summer 2 2018 is 6/8/2018 (date corresponding to day # 36) and Fall 1 2017 is 8/11/2017 (date corresponding to day #36). How do I go about getting these dates?
    School B 33 day pass for Summer 2 2018 is 6/8/2018 and Fall 1 2017 is 8/11/2017. 

    I set up a temp table with all the dates for Summer 2 2018 and Fall 1 2017 and use Row_Number function to assign a number for each date. Then update the ModifiedEndDate for Summer 2 and Fall 1 2017. This seems to be very cumbersome and wondering if there is a better way to accomplish this. The data do not line up well when i post, please see attached files. Your help/suggestion is greatly appreciated.

    Thanks in advance

  • Not all that many folks are willing to open an Excel spreadsheet from the internet, so not many will open it and look at your problem.   The best way to get help here is to post what we refer to as "consumable" data, which means CREATE TABLE statements along with INSERT statements with SAMPLE data representative of the domain of your problem, and ideally, also provide the expected results.  Pictures and spreadsheets are not the way to go.    However, those things said, I think you need a calendar table that identifies the school day of the year for each school.   Depending on the number of schools involved, you might have a table for each school, or you might consolidate to a single table with either a set of columns for each school (you only need ONE column for the date), or a date column and a school id column plus the day number for that school.  Think about how you would write the queries for each thing that you need to report, and design accordingly.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply