Highlight last entryitem from within a query
Hi there,
I have the following challenge :
I want to highlight the last news item(s) for today on our intranet homepage.
On that page I have created a query that shows the last 5 news items from a database, with a link to each item.
And also a link to all the other items:
Here is a sample to clearify what i mean.
| latest News | |
|---|---|
This is how it is setup right now:
<cfparam name="PageNum_NieuwsOverzicht" default="1">
<cfquery name="NieuwsOverzicht" datasource="Intranet" cachedwithin="#CreateTimeSpan(0,0,1,0)#">
SELECT NieuwsDatum, NieuwsKop, NieuwsId
FROM Nieuws
ORDER BY NieuwsDatum DESC
</cfquery>
<!---Repeat Region--->
<cfset MaxRows_NieuwsOverzicht=5>
<cfset StartRow_NieuwsOverzicht=Min((PageNum_NieuwsOverzicht-1)*MaxRows_NieuwsOverzicht+1,Max(NieuwsOverzicht.RecordCount,1))>
<cfset EndRow_NieuwsOverzicht=Min(StartRow_NieuwsOverzicht+MaxRows_NieuwsOverzicht-1,NieuwsOverzicht.RecordCount)>
<cfset TotalPages_NieuwsOverzicht=Ceiling(NieuwsOverzicht.RecordCount/MaxRows_NieuwsOverzicht)>
<cfset NieuwsId=NieuwsOverzicht.RecordCount>
How can I select (and somehow format) just the last item from within a query?
