SQL Statement

J

Joe Gonzalez

I have a table of just months and years for example:
2008-01
2008-02
2008-03
2008-04
2008-05
2008-06

And I have another table that is storing data that contains the date of say
2008-05.

I have a form with a drop down that displays the dates in the first table
but I want to only show dates that are not in the second table (the data
table) so for example since 2008-05 is in the data table I only want the drop
down to show
2008-01
2008-02
2008-03
2008-04
2008-06

I built the drop down as a row source and am trying to add it to a "SQL
Statement: Query Builder"

Any suggestions?
 
J

John Spencer

USe the unmatched query wizard to display what you want.

It should build a query that looks like the following.

SELECT Table1.YearMonth
FROM Table1 LEFT JOIN Table2
ON Table1.YearMonth = Table2.YearMonth
WHERE Table2.YearMonth is Null



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
J

Joe Gonzalez

PERFECT!!Thank you!

John Spencer said:
USe the unmatched query wizard to display what you want.

It should build a query that looks like the following.

SELECT Table1.YearMonth
FROM Table1 LEFT JOIN Table2
ON Table1.YearMonth = Table2.YearMonth
WHERE Table2.YearMonth is Null



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top