Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hoi there, Is it possible to ...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hoi there,

Is it possible to calculate a streak from a database ?
An example of a database containing the following data
(the upper row is the last played match)

won
won
lost
lost
lost
tie
won
won
won
won
tie
won
won
won
lost
lost

Now the streaks
The current streak is 2 won (the upper 2 rows)
If the next match wil be a lost, then the current streak will be 1 lost

The longest winning streak is 4 (the 7th, 8th, 9th and the 10th row)
The longest loosing streak is 3 (got it ?)
Is it posible to calculate this please ???

Hopend on an answer, I sent you my best regards

sencirely
Yelleke

Send your answer to: yelleke@yucom.be
 
This should set you on your way:


though you'll probably only get what you're after if you script something around it in a language of your choice.

I'd probably do something like you're suggesting with PHP and a series of if or case statements.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top