tags:

views:

43

answers:

0

I could not figure out the logic I would need to display a current minute of a soccer match. I have three fields in the database.

DateFirstStarted DateSecondStarted DateFullEnded

I should enter DateFirstStarted when the game starts and on the website. i.e. game starts at 7:05pm, on 7:25pm it should display '20 on the website. However, it should stop on the 45th minute. Then, I enter DateSecondStarted when the second half starts and should count from 46 to 90 and freeze there. Do I make sense? How can I do it? Is there a better way to do this?


Something not too complicated should do it. I will update start date of first half and start date of second half myself.

Here is how I tried it. I dont get an error but its not working. Any suggestion appreciated.

DateFirstStarted    =   objLiveCommentary("DateFirstStarted")
DateFirstEnded      =   DateAdd("n", 45, DateFirstStarted)
DateSecondStarted   =   objLiveCommentary("DateSecondStarted")
DateSecondEnded     =   DateAdd("n", 45, DateSecondStarted)

If      DateFirstStarted    =>  NOW()   =>  DateFirstEnded  Then
Response.Write "first half"
ElseIf  DateSecondStarted   =>  NOW()   =>  DateSecondEnded Then
Response.Write "second half"
End If