scouse
08-14-2007, 05:15 AM
Hi,
I've got an SQL query that is meant to pull the 5 most viewed articles from a database based on the last two days.
I've writen this
mostViewed = "SELECT top 5 * FROM content.dbo.features WHERE articletype='Review' AND (DateDiff('d', tLastViewed, date()) < 2) ORDER BY tCount DESC"
set mViewRS=Server.CreateObject("adodb.Recordset")
mViewRS.open mostViewed, conn
conn.Execute mostViewed
But its not working. The error it says is:
'date' is not a recognized built-in function name.
I've tried various different things, but I can't manage to get it to work. Has anyone got any ideas?
Thanks
Phil
I've got an SQL query that is meant to pull the 5 most viewed articles from a database based on the last two days.
I've writen this
mostViewed = "SELECT top 5 * FROM content.dbo.features WHERE articletype='Review' AND (DateDiff('d', tLastViewed, date()) < 2) ORDER BY tCount DESC"
set mViewRS=Server.CreateObject("adodb.Recordset")
mViewRS.open mostViewed, conn
conn.Execute mostViewed
But its not working. The error it says is:
'date' is not a recognized built-in function name.
I've tried various different things, but I can't manage to get it to work. Has anyone got any ideas?
Thanks
Phil