The Replicate() is simply going to add the number of 0's the front that you specify in the function (my example is 10). If your branch number always has a leading zero already (for 01 and 05 for example) but not for 17, then I'm confused on why it's not sorting the way you want it to.
Please provide a list of about 20 of the account numbers as they come out the database so we can see what the data is actually looking like. I may be missing something. Also, indicate HOW it is not sorting the way you want it, and then display the same list of 20 HOW you want it sorted. I think this will help us get to a solution faster. Dave -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 8:30 AM To: cf-newbie Subject: Re: Numerical order of query results Hi Dave, Thanks agan for sticking with me on this. Before looking at your second solution, I have a question about your first solution. This account number always starts with a branch number, in this case it is 01. This report will always be for a particular branch, so it will start with 01 or 05, or 17. There's not always a leading zero. But when there is a leading zero, I need the leading 0 to be always just one zero. Would that happen with REPLICATE()? For instance, it looks like I could get the following from REPLICATE(): 001234 012345 So the branch number would be 00 for one accont number and 01 for another, when they should all be 01. Am I right that this would happen with REPLICATE()? Meanwhile, I'll look at your other solution. Thanks Much, Lewis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:4107 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
