Content Management - Most Recent Entry (1 Viewer)

polgara

Registered User.
Local time
Today, 10:27
Joined
Feb 22, 2001
Messages
11
I'm developing a basic CMS for a small website and I'm just having some difficulty in getting my head around pulling the most recent entry to populate the page

Here's my current query:

SELECT tbl_page.PageTitle, tbl_content.PageContent, tbl_editor.EditorName, tbl_content.PublishDate, tbl_page.PageMetaKey, tbl_page.PageMetaDescription, tbl_page.PageID, tbl_content.PageHeader
FROM tbl_editor INNER JOIN (tbl_content INNER JOIN tbl_page ON tbl_content.PageRef = tbl_page.PageID) ON tbl_editor.EditorID = tbl_content.PageEditor

Can someone give me some direction?
 

David R

I know a few things...
Local time
Today, 04:27
Joined
Oct 23, 2001
Messages
2,633
If your query is correctly set up to sort the records (by PublishDate?), then use DoCmd.GoToRecord ,,acLast to jump to the last record on opening the form.
 

polgara

Registered User.
Local time
Today, 10:27
Joined
Feb 22, 2001
Messages
11
This is to populate a web page so I need to pull the last entry - its not an Access form.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:27
Joined
Feb 19, 2002
Messages
43,302
Change the query to select the Top 1 record and add an order by PublishDate Desc.

This will order the recordset in descending order by PublishDate so the newest one is first and the Top 1 will select just the first record.
 

Users who are viewing this thread

Top Bottom