Re: [sqlite] [Index] Listing 6001 after 601 and not after 801?
On Sun, 5 Oct 2008 08:52:21 -0600, "Dennis Cote" <[EMAIL PROTECTED]> wrote: >It sounds like you want the account numbers to be sorted as text rather than >numerically, so cast the values to text in the order by clause. > > ... order by cast(account_number as text) ... Thanks guys. An easier solution was simply to change the column definition from INTEGER to VARCHAR, since I didn't actually need the column to be numeric. Sorting works OK now. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] [Index] Listing 6001 after 601 and not after 801?
On Sun, Oct 5, 2008 at 7:59 AM, Gilles Ganault <[EMAIL PROTECTED]>wrote: > > This is for an accounting program: As an exemple, all accounts > starting with 6 must be listed together, which means that eg. 6001 > must come after 601, and not after, say, 801. It sounds like you want the account numbers to be sorted as text rather than numerically, so cast the values to text in the order by clause. ... order by cast(account_number as text) ... HTH Denis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] [Index] Listing 6001 after 601 and not after 801?
On Oct 5, 2008, at 3:59 PM, Gilles Ganault wrote: > Is there a trick in SQL that lets me do this? ORDER BY ASC won't do > this. order by to_char( account_id ) perhaps? -- PA. http://alt.textdrive.com/nanoki/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] [Index] Listing 6001 after 601 and not after 801?
Hello This is for an accounting program: As an exemple, all accounts starting with 6 must be listed together, which means that eg. 6001 must come after 601, and not after, say, 801. Is there a trick in SQL that lets me do this? ORDER BY ASC won't do this. Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users