none
Question: Joining two data sets with date conditions RRS feed

  • Question

  • Hi everyone,

     

    I'm pretty new with SQL, and I'm struggling to figure out a seemingly simple task.

     

    Here's the situation:

    • I'm working with two data sets
      • Data Set A, which is the most accurate but only refreshes every quarter
      • Data Set B, which has all the date, including the most recent data, but is overall less accurate
    • My goal is to combine both data sets where I would have Data Set A for all data up to the most recent quarter and Data Set B for anything after (i.e., all recent data not captured in Data Set A)

     

    For example:

    • Data Set A captures anything from Q1 2020 (January to March)
    • Let's say we are April 15th
    • Data Set B captures anything from Q1 2020 to the most current date, April 15th
    • My goal is to use Data Set A for all data from January to March 2020 (Q1) and then Data Set B for all data from April 1 to 15

     

    Any thoughts or advice on how to do this? Potentially a join function along with a date one?

    Any help would be much appreciated.

     

    Thanks in advance for the help.

    Monday, September 14, 2020 6:15 PM

All replies

  • Hi Marcalb

    The purpose of this forum is to support the Open Specifications documentation. You can read about the Microsoft Open Specifications program from http://www.microsoft.com/openspecifications/en/us/default.aspx

    I noticed that you have posted your question elsewhere. Good Luck on finding the answer you are looking for.



    HungChun Yu (MSFT)

    Tuesday, September 15, 2020 11:04 AM