PC Review


Reply
Thread Tools Rate Thread

delete query

 
 
inungh
Guest
Posts: n/a
 
      20th May 2010
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,

 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      20th May 2010
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


 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      20th May 2010
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
>
>
> .
>

 
Reply With Quote
 
inungh
Guest
Posts: n/a
 
      20th May 2010
On May 20, 10:50*am, "Bob Barrows" <reb01...@NOyahoo.SPAMcom> 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,
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Query - Delete matching records from 2 tables - Access 2000 Chris Stammers Microsoft Access Queries 4 22nd Jan 2009 02:45 PM
Delete query unable to delete records from table. Fix how? =?Utf-8?B?TG9uZ1RvbQ==?= Microsoft Access Queries 8 15th Apr 2007 11:29 AM
Delete Query Error "Can't delete from specified tables Maureen227 Microsoft Access Queries 4 26th Jul 2006 04:58 PM
Delete Query Error "Can't delete from specified tables Maureen227 Microsoft Access 6 26th Jul 2006 03:36 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) resant_v@yahoo.com Microsoft Excel Misc 1 8th Mar 2006 10:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:15 AM.