Re: order by numeric value

2010-04-28 Thread Martijn Tonies
But I'd prefer not to see the extra sorting field. You don't need to select a field in order to be able to order by it. So select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as Debit,

order by numeric value

2010-04-27 Thread Keith Clark
I have the following statement: select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as Debit, concat('$',format(coalesce(sum(sales_journal_entries.credit),0),2)) as Credit,

Re: order by numeric value

2010-04-27 Thread Carsten Pedersen
Keith Clark skrev: I have the following statement: select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as Debit, concat('$',format(coalesce(sum(sales_journal_entries.credit),0),2)) as Credit,

Re: order by numeric value

2010-04-27 Thread Keith Clark
On Wed, 2010-04-28 at 00:18 +0200, Carsten Pedersen wrote: Keith Clark skrev: I have the following statement: select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as Debit,

Re: order by numeric value

2010-04-27 Thread DaWiz
Try order by CAST(Balance as decimal(8,2)) asc; Cast will work in the order by. Glenn Vaughn - Original Message - From: Keith Clark keithcl...@k-wbookworm.com To: mysql@lists.mysql.com Sent: Tuesday, April 27, 2010 3:52 PM Subject: order by numeric value I have the following

RE: order by numeric value

2010-04-27 Thread Gavin Towey
: Tuesday, April 27, 2010 3:46 PM To: Keith Clark; mysql@lists.mysql.com Subject: Re: order by numeric value Try order by CAST(Balance as decimal(8,2)) asc; Cast will work in the order by. Glenn Vaughn - Original Message - From: Keith Clark keithcl...@k-wbookworm.com To: mysql

RE: order by numeric value

2010-04-27 Thread Keith Clark
without the dollar sign and order on that column. Regards, Gavin Towey -Original Message- From: DaWiz [mailto:da...@dawiz.net] Sent: Tuesday, April 27, 2010 3:46 PM To: Keith Clark; mysql@lists.mysql.com Subject: Re: order by numeric value Try order by CAST(Balance

Re: order by numeric value

2010-04-27 Thread Jesper Wisborg Krogh
On Wed, 28 Apr 2010 08:53:57 Keith Clark wrote: But I'd prefer not to see the extra sorting field. You don't need to select a field in order to be able to order by it. So select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as

Re: order by numeric value

2010-04-27 Thread Keith Clark
On Wed, 2010-04-28 at 08:57 +1000, Jesper Wisborg Krogh wrote: On Wed, 28 Apr 2010 08:53:57 Keith Clark wrote: But I'd prefer not to see the extra sorting field. You don't need to select a field in order to be able to order by it. So select chart_of_accounts.accountname as Account,