Forums

This topic is locked

vote average

Posted 26 Dec 2002 00:32:23
1
has voted
26 Dec 2002 00:32:23 Simon Jones posted:
I have a problem with displaying the averages for my different photos.

I have tried it in different ways and they both have a dead end!

if i figure out the averages in SQL then I'd use voteVALUE/voteCOUNT. This is all well and good as I can order the records by the averages which I want to do. The problem is when there is a new photo as the voteVALUE and voteCOUNT would both be zero.. therefore there would be a division by zero error

the next method is to declare it as a variable as asp (i dont have much experience in this)... I got the averages to work and it would display amongst the correct record in a repeated region.. the problem I have here is that I don't know how to ORDER the records by the voteAVERAGE variable <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>

so there my problem is... if anyone has a solution to either problem I would be very appreciative.

<font color=red><b>merry christmas</b></font id=red>

Replies

Replied 27 Dec 2002 14:23:49
27 Dec 2002 14:23:49 Marcellino Bommezijn replied:
Download this example and see how it was build.

www.dmxzone.com/ShowDetail.asp?NewsId=680
Replied 27 Dec 2002 21:20:10
27 Dec 2002 21:20:10 Simon Jones replied:
looking at the demo it doesnt order by the rating... but I'll check it out to see how they declared the average.

thanks.
Replied 02 Jan 2003 19:34:19
02 Jan 2003 19:34:19 Simon Jones replied:
I looked at the way that this example declared the vote average...

it basically is how I am doing it at the moment (if votecount and votevalue is &lt;&gt; 0 then divide them to find the average..)

still no way to order them though <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>

Reply to this topic