Custom database results query

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I am trying to create a custom database results query that
does the following:

I want to display the top 5 results of a query EXCEPT the
first listing. In other words, I want to display results
2-5 of the query. Does anyone know the commands to put in
a custom database results query to do this?
 
You need to be able to test for a value in a field that would be true or
false, etc.

Such as:

Select .... Where fieldname = True...

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Thanks for your response. I am testing for values with
the following query:

SELECT * FROM Articles WHERE (PublishNow = 1) AND
(Blueprint = 1) ORDER BY "Article Date" DESC

Using this, is there a way to omit the first record
returned?

The reason I am trying to do this is that I want to
display detailed information for the first record
returned, and only summary information for records 2-5. I
have set up two different database results areas on my
page to define the different formating for result 1 and
for results 2-5.
 
Are records 2-5 some how related to record 1?

Is your goal to do something like the following site:
http://www.artglassinfo.com
where you see the "New" issue which is displaying the a full description of
the issue, and then when you click on "Review Table of Contents..." link you
are taken to another page where you now see the issue description as well as
list of the Articles contained in the issue.

If so this is accomplished by using two queries, the first query grabs the
info for the Issue, based on the Issue ID, which in turn provide a value for
the second query so that it can retrieve all articles related to the
specific Issue.

Both the Issues content and the Article TOC content are stored in the same
table. This is all hand coded ASP/Access, as I don't use the FP database
components.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Records 2-5 (for clarification, these are not ID numbers,
but the order that records will be returned based on the
query 'ORDER BY "Article Date" DESC') and 1 similar in
format but each is about a different subject. Each record
contains the same type of information, but about a
completely different news story.

Regarding your example, here's a way to describe what I'm
trying to do in relation to your sample page. At the top
of your page, for Vol1-Iss8, the first issue displayed
(which will always the be the latest issue), all of the
information you are currently showing on the page would be
present. For the subsequent issues under "Recent Issues
Still Available" I would want to display less information
in the interest of shortening the page. So, for these
records on this page, I would only show the volume and
issue number and title (such as "Vol1-Iss7: PEOPLE &
PLACES") followed by the link "Review Table of
Contents..." I would not want to display the image and
the issue description.

I hope that helps to better explain what I am trying to
do. Thanks for your help.
 
Paul,

Ok on the home page I am running 3 queries, the first query grabs the
current issue based on a Y/N field in the database indicate which is the
current issue, and the second query grab the two recent issue currently
available based on a Y/N field in the database, and the third query grabs
the sample issue by it Issue ID as it never changes.

You can choose what fields or how must info to be displayed, however the
case of this site, more info is better for the search engines to index.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Thank you for all of your help with this, Thomas.
-----Original Message-----
Paul,

Ok on the home page I am running 3 queries, the first query grabs the
current issue based on a Y/N field in the database indicate which is the
current issue, and the second query grab the two recent issue currently
available based on a Y/N field in the database, and the third query grabs
the sample issue by it Issue ID as it never changes.

You can choose what fields or how must info to be displayed, however the
case of this site, more info is better for the search engines to index.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp




.
 
SELECT TOP 5 *
FROM TableName
WHERE ID Not In (SELECT Top 1 ID FROM TableName Order By Name DESC)
ORDER BY Name DESC;
 
Back
Top