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
|
|||
|
|||
How do I limit the number of records in a query.
If I have a query that is combining information from two or more tables, one
of which has a date field, and I want to limit the query to the most current 20 records, how would I do this? |
#2
|
|||
|
|||
In SQL view of the query, changing
Select to Select Top 20 will give you the the top 20 (or less) records. The date field must be sorted in Desc order to get the most current records. HTH Steve -------------------------------- "Veni, Vidi, Velcro" (I came; I saw; I stuck around.) "rnprice" wrote: If I have a query that is combining information from two or more tables, one of which has a date field, and I want to limit the query to the most current 20 records, how would I do this? |
#3
|
|||
|
|||
Thank you. The query actually read "SELECT DISTINCTROW" so I had to replace
"DISTINCTROW" with "Top 20". It looks like it is working fine. Thanks again. "SteveS" wrote: In SQL view of the query, changing Select to Select Top 20 will give you the the top 20 (or less) records. The date field must be sorted in Desc order to get the most current records. HTH Steve -------------------------------- "Veni, Vidi, Velcro" (I came; I saw; I stuck around.) "rnprice" wrote: If I have a query that is combining information from two or more tables, one of which has a date field, and I want to limit the query to the most current 20 records, how would I do this? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New records can't be seen | rleblanc | Using Forms | 6 | August 14th, 2004 02:43 PM |
Use Combo box to limit records when subform is based on query? | Steve C | Using Forms | 1 | July 29th, 2004 04:35 AM |
EXISTS reserved word in FROM clause | Stephanie Doherty | Running & Setting Up Queries | 6 | July 21st, 2004 01:15 AM |
surely a form with a ListBox can be used in a query? | 1.156 | Running & Setting Up Queries | 14 | June 2nd, 2004 04:54 PM |