Union query for countries table and sales data table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vish Narayan
    New Member
    • Jun 2011
    • 24

    Union query for countries table and sales data table

    I have a table where users enter the sales forecast for each quarter for each country for each business type. I have another table which is the Country master which only has a country code and country name. Countries that have no sales are ignored. Not even entered as "zero". My problem is that I need to create a standard report with all the countries shown for each quarter for each business type including those that had no sales ( null ). I tried to create a query that uses all records from the country master and the matching records from the Sales forecast but that gives an error . I cannot create a union query using the country master and the sales forecast since the columns in the country master are only two while the sales forecast has many. Is there a solution?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use an outer join. That's as specific as I can get. It would help if you posted the SQL you tried.

    Comment

    • mshmyob
      Recognized Expert Contributor
      • Jan 2008
      • 903

      #3
      Sounds like you want an Left Outer Join or a Right Outer Join. Show the query you are currently using.

      cheers,

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32645

        #4
        Please check out these links before posting any new questions :
        How to ask "good" questions -- READ BEFORE SUBMITTING A QUESTION!.
        Before Posting (VBA or SQL) Code.

        Comment

        Working...