473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Pulling a set of records

I have a large table in Access 2003 where I am searching for a specific piece of criteria in one of the rows. When it finds this criteria I need the database to take this row, as well as the next four rows, and place them into a new table. Is there anyway this can be done?
Oct 15 '10 #1
5 1205
nico5038
3,080 Expert 2GB
First make a select query setting the criteria and then change the query type into a "MakeTable" or "Append" query.

Nic;o)
Oct 15 '10 #2
NeoPa
32,556 Expert Mod 16PB
John Jacobs:
When it finds this criteria I need the database to take this row, as well as the next four rows,
How would you define the next four rows, bearing in mind this has no meaning within an RDBMS without a defined context. Records are not stored in any predefined order.
Oct 15 '10 #3
nico5038
3,080 Expert 2GB
Good point NeoPa, it can be delivered when there's a sequence by using the TOP 5
But without a sequence or relation defined in a field it's not possible to get a "stable" set.

Nic;o)
Oct 15 '10 #4
I have it set to automatically add a primary key each time the file is imported. The only problem is depending on whether or not data is added or taken away on the source file could alter the record number the criteria I am looking could be on. Once a select query finds the criteria, is there anyway to tell it to pull the next four rows based on the primary key?
Oct 18 '10 #5
NeoPa
32,556 Expert Mod 16PB
John Jacobs:
Once a select query finds the criteria, is there anyway to tell it to pull the next four rows based on the primary key?
Yes. I refer you back to the previous post (#4) where the approach is outlined for you.
Oct 19 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Jeff | last post by:
Hey gang. i have a code that i will list. when varM = 8 or 16, the script works fine, and pulls the top 8 or top 16, but if it =32 or 64, it is only pulling the top 17 records from the DB. db is...
3
by: dbarker1 | last post by:
Hello All, I am developing a web front end using the standard datagrid in the 1.1 framework. Currently it allows users to navigate through records 20 at a time via previous and next buttons. ...
6
by: Christo | last post by:
I have this script for showing news on a page, but i want it to only show the last 10 records, as in the 10 records that were added to the database last. the script shows the entries in descending...
20
by: scolivas | last post by:
I have a query that is pulling from a table of 35000+ records But for some reason any records beyond 25999 are not coming thru. The Table is a list employees - and thier assignments - so there...
6
by: Kevin | last post by:
On some records, the calculation is correct but on others it is wrong, why? the calculation is as follows (the source of each part of the calculation is below it): txtActualWage =\ ...
3
by: Cindy | last post by:
I'm trying to use the NEWID function in dynamic SQL and get an error message Incorrect syntax near the keyword 'ORDER'. Looks like I can't do an insert with an Order by clause. Here's the code:...
4
by: kdubble | last post by:
Hi I am trying to get the results of a query to show only unique student records (not duplicates). Is there a simple way to make the criteria field do this? I am not too familiar with SQL. ...
3
by: BobRoyAce | last post by:
I am using Visual Studio 2008 w/ VB.NET. For the database, I am using SQL Server 2005, which is running on a dedicated server box. I am creating a WinForms application for a client. It is run...
13
by: angi35 | last post by:
Hi - working in Access 2000... my goal is to combine fields from two tables in a query: Table 1 has ItemNumber and ItemDescription. There's only one record per ItemNumber. Table 2 has ItemAlias....
2
by: nspader | last post by:
OK, I am pulling my hair out on this one. It seems like it should be so simple and I cannot seem to find the answer. I am using Access 2000 on Windows 2000. I have two tables set up. Table...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.