Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First row of the field in a table

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
0
0
BG
Is there any way to refer to figure in the frist row of the field in the table. The field is called afid.For example, if the figure in the first row is 1, or afid = 1, then to delete all the other figures:

StrSQL = " DELETE tblClients1.*, tblClients1.afid FROM tblClients1 WHERE (((tblClients1.afid)>1))"
 
smotek
You are mixing your terms badly and so what you are asking makes no sense at all.

A Table has ROWs
( None, one or more rows )

Each Row consists of a number of Fields
Each field has a specific type and at least one Field should be a Primary Key which uniquely defines a particuar Row.

So ".. the first row of the field .." has no meaning that I can dissern.

From the SQL you quote
StrSQL = "DELETE * FROM tblClients1 WHERE afid > 1 "

Will delete all of the rows in the table where the afid is greater than 1
( Note afid = -47 will not be deleted, so if there is any chance of afid being zero or negative then use " .. afid <> 1 " )




G LS
 
Another thing to remember that, unlike a spreadsheet, there is no such thing as a "first" row in a database table.

If you run a SELECT statement on a table and do not specify an ORDER BY, which row displays first is completely unpredictable.


 
samotek,

Are you wanting to delete all the "characters" in a field (except for the first character), where the first character is a "1" ?

Or do you want to delete the entire record (row) where the field [afid] = 1

Hovercraft
 
Something like this ?
StrSQL = "DELETE * FROM tblClients1 WHERE afid>" & DMin("afid", "tblClients1")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top