I have an article db that currently shows one article based on the most current Active date “CurrDate(Now)”
is my function to find the most current article. I would like to display the most current article for each “ArticleZone” in the db.
For example my asp page would look something like this:
First post on a new board and I abandon it for a month.
What can I say there’s no internet in jail. Don’t worry I’m a bad guy
I just forgot to pay my taxes for a few decades so Uncle Sam wasn’t too happy.
Thanks rneale for the reply, you had asked:
How will select the most recent article if multiples exist for the same date and articlezone ?
Well the answer to both our questions was more than just a SQL Statement.
Here is the completed working script it’s pretty simple. I left out the include file that handles article selection,
its function “SQLDate(Now)” is called from the SQL Statement in the script and compares the current date with the each articles active date.
<!-- #include file="SQLDate.asp" -->
Select Case zone
strZone = "zone1"
strZone = "zone2"
strZone = "zone3"
strZone = ""
SQL = "SELECT * FROM Articles WHERE ActiveDate <= "&SQLDate(Now)&" _
& "AND ArticleZone = '"&strZone&"' ORDER BY ActiveDate DESC"
If strZone <> "" Then
If Not Rs.EOF Then
Response.Write(Rs("ArticleName") And Rs("ArticleData"))
Response.Write "No Articles Found"
Disply the records