A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

delete query



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2010, 03:19 PM posted to microsoft.public.access.queries
inungh
external usenet poster
 
Posts: 177
Default delete query

I would like to delete first 3 records of the table.
I know that I can set criteria to delete certain records in the table,
but are there any way to set criteria only the first 3 or 4 records?

Your information is great appreciated,

  #2  
Old May 20th, 2010, 03:50 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default delete query

inungh wrote:
I would like to delete first 3 records of the table.
I know that I can set criteria to delete certain records in the table,
but are there any way to set criteria only the first 3 or 4 records?

Your information is great appreciated,


You really need to define the criteria to identify the "first" 3 records
in your table. Records can be stored in an entirely different order from
that with which they are displayed. In a relational database, tables are
defined as sets of unordered rows.

Without a numerically increasing row identifier (primary key), the best
you can do is a 3-step process:
1. Add an autonumber field
2. delete * from table where autonumber_field 4
3. Delete the autonumber field.

--
HTH,
Bob Barrows


  #3  
Old May 20th, 2010, 05:05 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default delete query

I suggest including two more steps --
Step 0- Backup database
After step 1 add - verify the autonumbers of the records to be deleted.

--
Build a little, test a little.


"Bob Barrows" wrote:

inungh wrote:
I would like to delete first 3 records of the table.
I know that I can set criteria to delete certain records in the table,
but are there any way to set criteria only the first 3 or 4 records?

Your information is great appreciated,


You really need to define the criteria to identify the "first" 3 records
in your table. Records can be stored in an entirely different order from
that with which they are displayed. In a relational database, tables are
defined as sets of unordered rows.

Without a numerically increasing row identifier (primary key), the best
you can do is a 3-step process:
1. Add an autonumber field
2. delete * from table where autonumber_field 4
3. Delete the autonumber field.

--
HTH,
Bob Barrows


.

  #4  
Old May 20th, 2010, 05:21 PM posted to microsoft.public.access.queries
inungh
external usenet poster
 
Posts: 177
Default delete query

On May 20, 10:50*am, "Bob Barrows" wrote:
inungh wrote:
I would like to delete first 3 records of the table.
I know that I can set criteria to delete certain records in the table,
but are there any way to set criteria only the first 3 or 4 records?


Your information is great appreciated,


You really need to define the criteria to identify the "first" 3 records
in your table. Records can be stored in an entirely different order from
that with which they are displayed. In a relational database, tables are
defined as sets of unordered rows.

Without a numerically increasing row identifier (primary key), the best
you can do is a 3-step process:
1. Add an autonumber field
2. delete * from table where autonumber_field 4
3. Delete the autonumber field.

--
HTH,
Bob Barrows


Thanks millions for helping,
I find the way to identify the records without knowing order of the
records.

Thanks again for helping,
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.