Eros
Posts: 4
|
Posted: 06/08/2009, 9:14 AM |
|
Hi all,
I've built a game scoring web site. Every game has its own way of scoring results: there are games where the highest value means best score, there are games where the lowest value means best score. In case of equal scores the first score arrived to the system is the best.
So I have a table for scores where every score has (among others) the following field: GameID, ScoreValue, ScoreDate
In Game table (linked by GameID with Scores) I have a field called ScoreType that tells if best scores are from top or from bottom.
So my question is: how can I dynamically sort my Grid based on ScoreType field?
So something like:
IF ScoreType = 1 (highest is best) then ORDER BY ScoreValue DESC, ScoreDate
IF ScoreType = 2 (lowest is best) then ORDER BY ScoreValue, ScoreDate
I need to compose SQL statement on the fly and pass to ... what?
I do not know how to pass a dynamically created SQL statement to a Grid recordset.
Thanks a lot for any help
Eros
|
|
|
kevind
Posts: 251
|
Posted: 06/17/2009, 5:56 AM |
|
hi there,
go into ccs and open the help screen and expand the branches:
- examples and techniques
- programming
- customizing the data source
- dynamically modify the order by clause
that should do it for you
let me know this helped
kd
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
|
|
|