Hi there,
I have been struggling with a SQL statement for a while now.
I cant seem to get it into the right order. Here is the SQL...
select left(supp_registrationdatetime, 11), count(left(supp_registrationdatetime, 11))
from supporter_details sd, supporter_registered_emailadd sr
where sd.supp_number = sr.supp_number
and supp_registrationdatetime > 'Jan 26 2003'
group by left(supp_registrationdatetime, 11)
order by left(supp_registrationdatetime, 11) asc
..it returns a list of dates and a count of how many times they occurred. The only problem is that the order of the record set is in alphabetical order with the Date..example:
Feb 26 2003 2
Feb 27 2003 1
Feb 28 2003 1
Jan 26 2003 3
Jan 27 2003 5
Jan 28 2003 5
Jan 29 2003 2
Jan 30 2003 6
Jan 31 2003 3
Mar 3 2003 2
I want the order to be as follows....
Jan 26 2003 3
Jan 27 2003 5
Jan 28 2003 5
Jan 29 2003 2
Jan 30 2003 6
Jan 31 2003 3
Feb 26 2003 2
Feb 27 2003 1
Feb 28 2003 1
Mar 3 2003 2
can anyone help me? cheers! jstar7
-------------------------------------
...what rhymes with month?
I have been struggling with a SQL statement for a while now.
I cant seem to get it into the right order. Here is the SQL...
select left(supp_registrationdatetime, 11), count(left(supp_registrationdatetime, 11))
from supporter_details sd, supporter_registered_emailadd sr
where sd.supp_number = sr.supp_number
and supp_registrationdatetime > 'Jan 26 2003'
group by left(supp_registrationdatetime, 11)
order by left(supp_registrationdatetime, 11) asc
..it returns a list of dates and a count of how many times they occurred. The only problem is that the order of the record set is in alphabetical order with the Date..example:
Feb 26 2003 2
Feb 27 2003 1
Feb 28 2003 1
Jan 26 2003 3
Jan 27 2003 5
Jan 28 2003 5
Jan 29 2003 2
Jan 30 2003 6
Jan 31 2003 3
Mar 3 2003 2
I want the order to be as follows....
Jan 26 2003 3
Jan 27 2003 5
Jan 28 2003 5
Jan 29 2003 2
Jan 30 2003 6
Jan 31 2003 3
Feb 26 2003 2
Feb 27 2003 1
Feb 28 2003 1
Mar 3 2003 2
can anyone help me? cheers! jstar7
-------------------------------------
...what rhymes with month?