I got this error.
Incorrect syntax near ')'. 

-----Original Message-----
From: Dave Phillips <[EMAIL PROTECTED]>
To: cf-newbie <[email protected]>
Sent: Wed, 29 Oct 2008 3:23 pm
Subject: RE: Numerical order of query results



Okay, Lewis.  I got your table, now I understand a bit better.  Try this:
ORDER BY SUBSTRING(a.Clco,1,2)+REPLICATE('0', 10 -
EN(SUBSTRING(a.Clco,3,LEN(a.Clco)))+ SUBSTRING(a.Clco,3,LEN(a.ClCo))
Okay, that looks crazy, but here's what it SHOULD do (and remember, these
alues are ONLY for sorting - this will NOT change how your account numbers
re displayed).
Take the first two digits, which is the branch, then add zeros (to 10
laces, for scalability purposes) to the beginning of the account number,
hen add the rest of the account number.
So, your initial sort (abbreviated here):
0110192
0110193
0110194
011070
011103
011138
01DEMO
Should look like this (for the ORDER BY operation only):
010000010192
10000010193
10000010194
10000001070
10000001103
10000001138
1000000DEMO
Now, they should sort properly and display on your page like this:
010000001070
10000001103
10000001138
1000000DEMO
10000010192
10000010193
10000010194
Let me know if that works.
-----Original Message-----
rom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
ent: Wednesday, October 29, 2008 1:58 PM
o: cf-newbie
ubject: Re: Numerical order of query results
Did you get the email with the table I sent?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4119
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to