Skip to main content
Inspiring
September 6, 2012
Question

How can I get the last 18 numbers from this string

  • September 6, 2012
  • 1 reply
  • 563 views

Hi,

I'm querying this field from a table. How can I only get the last 18 numbers:

The numbers look like this:

500000000818118

This topic has been closed for replies.

1 reply

Miguel-F
Inspiring
September 6, 2012

If it is always the last 18 numbers just use the Right() function.  Examples:

Right("500000000818118", 18)

or

<cfset mystring = "500000000818118">

<cfset mynewstring = Right(mystring, 18)>

or

#Right(yourquerycolumn, 18)#

etc.

Edit:

Well I just noticed that your example string is only 15 characters long.  Perhaps I mis-understood your question?

Message was edited by: Miguel-F