|
From: Joe Gonzalez on 30 Jun 2008 11:41 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?
From: John Spencer on 30 Jun 2008 12:09 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 Joe Gonzalez wrote: > 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? >
From: Joe Gonzalez on 30 Jun 2008 13:18 PERFECT!!Thank you! "John Spencer" wrote: > 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 > > Joe Gonzalez wrote: > > 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? > > >
|
Pages: 1 Prev: help with a query Next: Query for two fields in one record that do not match |