CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Sorting dynamically by a variable setup

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.