Hey,
I have a voting system for images for a competition a client is holding. I have 2 tables: entry and votetrail.
I need to know the statement to be able to count who has the highest votes at any particular date/time in the past.
My tables look like this:
Entry:
--------------------------------------------------
id | Name | ImageLink |Timestamp
--------------------------------------------------
54 | Sum Body |image23.jpg |2010-10-17 10:04:14
58 | Joe Bloggs |image101.jpg |2010-10-19 10:04:14
Votetrail:
----------------------------------------------------
id| EntryId | VoterId | Timestamp
----------------------------------------------------
23| 54 |367 | 2010-10-17 10:10:34
24| 54 |369 | 2010-10-18 13:10:14
25| 58 |375 | 2010-10-19 10:06:18
26| 54 |356 | 2010-10-19 10:10:15
So the result I would like to see for results on or before 2010-10-19 10:30:00 would be:
-----------------------------------------
Entryid | ImageName |EntrantName |Votes|
54 | Image23.jpg | Sum Body | 4 |
58 | Image101.jpg | Joe Bloggs | 1 |
-------------------------------------------
Thanks...
Reality is built on a foundation of dreams.
I have a voting system for images for a competition a client is holding. I have 2 tables: entry and votetrail.
I need to know the statement to be able to count who has the highest votes at any particular date/time in the past.
My tables look like this:
Entry:
--------------------------------------------------
id | Name | ImageLink |Timestamp
--------------------------------------------------
54 | Sum Body |image23.jpg |2010-10-17 10:04:14
58 | Joe Bloggs |image101.jpg |2010-10-19 10:04:14
Votetrail:
----------------------------------------------------
id| EntryId | VoterId | Timestamp
----------------------------------------------------
23| 54 |367 | 2010-10-17 10:10:34
24| 54 |369 | 2010-10-18 13:10:14
25| 58 |375 | 2010-10-19 10:06:18
26| 54 |356 | 2010-10-19 10:10:15
So the result I would like to see for results on or before 2010-10-19 10:30:00 would be:
-----------------------------------------
Entryid | ImageName |EntrantName |Votes|
54 | Image23.jpg | Sum Body | 4 |
58 | Image101.jpg | Joe Bloggs | 1 |
-------------------------------------------
Thanks...
Reality is built on a foundation of dreams.