-
Date Order
Dear Experts
Table1 has following data
date----------weight
14/01/2010------5
14/01/2010------10
15/01/2010------20
02/02/2010------35
I use followin query
Code:
str = "SELECT RANK() OVER(ORDER BY date) AS sno ,date, SUM(weight) AS weight FROM table1 GROUP BY Date" dt = GetTable(str)str = "SELECT RANK() OVER(ORDER BY date) AS sno ,date, SUM(weight) AS weight FROM table1 GROUP BY Date order by date"
dt = GetTable(str)
The query generates these results
1----02/02/2010------35
2----14/01/2010------15
3----15/01/2010------20
This is not order by date as you can see
I want to display data index on date order as
1----14/01/2010------15
2----15/01/2010------20
3----02/02/2010------35
Please help
-
Re: Date Order
Apply the Desc keyword to the sort list as
Code:
SELECT RANK() OVER(ORDER BY date) AS sno ,date, SUM(weight) AS weight FROM table1 GROUP BY Date Order by Date desc
-
Re: Date Order
sorry sir,
your method does not work
following result are displayed by add DESC at the end of query
1----02/02/2010------35
2----15/01/2010------20
3----14/01/2010------15
but i want these results
1----14/01/2010------15
2----15/01/2010------20
3----02/02/2010------35
-
Re: Date Order
Sorry for that. See the second post here
-
Re: Date Order
Moved To Database Development