SQLTeam.com | Weblogs | Forums

Help quering data from 2 tables where one table requires date Parameter


I have two tables,
Table 1 is Sales Summary Data
Table 2 is Contract pricing

Both have

I Need to extract all the contract pricing from Table 2 and All Sales Data from Table 1 Based on a specific period (this would change based on the customer)

My Problem is that I end up losing any Contract pricing data where no sale has occurred I need all results from Contract pricing.
Where there is a sale that should be added where there is no sale just a 0 value and vice versa I require the items that had a sale but were not on the contract price list as well .



I think we need more info, Can you provide:

CREATE TABLE statements for both tables
INSERT INTO statements to populate both tables with data that will show the situation
Your query so far (working or not)
The expected results from a correct query, using the test data above