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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a database by part of the field 1

Status
Not open for further replies.

btween

Programmer
Aug 7, 2003
338
US
I have an access database that has a simple table with 2 fields:

id and url.

It basically stores a large numer of web domains. What I'm trying to do is sort this table by extensions, so I can have all the .coms together followed by the .nets, and I don't know how to query it to do this.

the second thing I need to do is sort by a part of the domain name.

Let's assume I have 2 sites one, and
How can I get these 2 to be together, sorted by the common word chess.

Any help would be greatly appreciated.
 
btween,

Code:
select *, right(url,3) as EXT from Domains order by right(url,3)
On your second requirement, will you be selecting on a single string of your choice like "chess"?

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
You can't group URL's by a part of the domain name if you don't know where in the domain name "chess" is. However, you can group domains with "chess" in them if you filter all of the URL's, looking for those with "chess" in it by the following:

DoCmd.AppyFilter , "URL Like '*chess*'"

[shadeshappy] Cruising the Information Superhighway
(your mileage may vary)
 
I tried running this query

SELECT url
FROM tblName;

DoCmd.ApplyFilter , "url Like '*chess*'"

but I am getting an error: characters found after end of sql.


I am assuming this command has to be integrated in the query. Any help with the syntax would be great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top