> is there a function in transact sql that allows something
> like the cfmx insert() function?
>
> I have a number field, 1236547852145632, that I want to
> display like:
>
> 1236-5478-5214-5632
>
> and don't want to do this...
>
> <cfset myNum = 4103346331>
>
> <cfloop from = 4 to = #len(myNum)# index = i step = 5>
> <cfset myNum = insert('-',myNum,i)>
> </cfloop>
>
> too many times in a 10000 query recordset :) if I can pass it
> off to sql server, GREAT!

There's no built-in function that does exactly what you want, but I'm pretty
sure you can use the SUBSTRING function to get where you want to go. You
might even write your own SQL Server user-defined function that uses it.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to