Forums

This topic is locked

Displaying Data Help

Posted 14 Aug 2002 17:45:59
1
has voted
14 Aug 2002 17:45:59 Dan Berdusco posted:
I am sure that there is a simple answer to this but my mind isn't working properly this morning. Maybe someone can help me out... The site I am creating has a news section and the news data is getting pulled from a database ordered by date. What I want to do is show the Most recent news with a title, date, news and an image. BUT, right under that, I would like to show the next 5 news entries but only their title and date. Each of these will link to a detail page.

How can I show those 5 entries and not show the first entry that would have already been displayed in full right above?

Thanks in advance.

Replies

Replied 15 Aug 2002 10:30:15
15 Aug 2002 10:30:15 Julio Taylor replied:
you'll need to make 2 recordsets:

1)
<pre id=code><font face=courier size=2 id=code>
SELECT * FROM news ORDER BY date DESC
</font id=code></pre id=code>

2)
[code]
select * from news WHERE date &lt; MAX(date) ORDER BY date DESC &lt;-- (i'm not sure about this one, test it out)

Then you can lay out only the top record, in full expanded mode, and use the headlines, recordset2 (excluding the newest record through the SQL) to display the headlines of the other news items.

i'm not sure if the SQL for Rec.2 is correct, haven't tested it.

Hope it helps.

------------------------
Poolio

MSN:

www.eliziumdesign.com
Replied 15 Aug 2002 18:38:33
15 Aug 2002 18:38:33 Dan Berdusco replied:
I cannot use an aggregate function such as MIN, MAX, AVG, COUNT, etc in the WHERE clause... Can you think of any other way to do this???

Thanks again

Reply to this topic