This routine gives me an "data type mismatch in criteria expression" error:
function GetTopicRatingAvg( iTopicID )
if request("ARCHIVE")="true" then
strActivePrefix = strTablePrefix & "A_"
ArchiveView = "true"
ArchiveLink = "ARCHIVE=true&"
nDays = "0"
else
strActivePrefix = strTablePrefix
ArchiveView = ""
ArchiveLink = ""
end if
strSQL = ""
strSQL = "SELECT TOPIC_RATING_TOTAL, TOPIC_RATING_TOTAL_COUNT "
strSQL = strSQL & "FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID = '" & iTopicID & "'"
set rsTopicRating = Server.CreateObject("ADODB.Recordset")
rsTopicRating = my_Conn.Execute( strSQL )
if rsTopicRating("TOPIC_RATING_TOTAL_COUNT") = 0 then
iTopicRating = 0
else
iTopicRating = cint(rsTopicRating("TOPIC_RATING_TOTAL") / rsTopicRating("TOPIC_RATING_TOTAL_COUNT") )
end if
set rsTopicRating = nothing
GetTopicRatingAvg = iTopicRating
end function
I posted about it (with a link to the file in .txt format) in the support, current version forum but my post got deleted again. I can't spot anything wrong with the function, but I've been looking at it too long.<