If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
SQL Statement
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? |
#2
|
|||
|
|||
SQL Statement
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? |
#3
|
|||
|
|||
SQL Statement
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? |
Thread Tools | |
Display Modes | |
|
|