How only show first n characters of field when fields are long

I used to have a document on how to do this but lost it.
How do I specify for a field to display the first so many characters in a given field when the field is too long to display in a table?

sjurick wrote:
Sorry, I'm using PHP, and MySQL.
It depends if you want to either truncate the results from the select statement in the script,  or limit what is being returned by the select. You can use the php substr function
http://www.php.net/manual/en/book.strings.php
or the SQL Left() functions
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_left

Similar Messages

  • How To: Extract first three characters of a text field

    Greetings --
    What is the best method for extracting the first three
    letters of a text field?
    I need to extract the first three letters of a text field (in
    this case Last Name),
    so I add it to other components so as to create an
    identification number for
    a person.
    This identification number that needs to be created is
    comprised of the
    person's date of birth, last 4 numbers of the social security
    number and
    the the first three letters of the person's last name.
    Example:
    ==> Birthdate: 11/15/45
    ==> Last 4 SSN: 6654
    ==> Last Name: Smith
    ID Number would be:
    ==> 1115456654SMI
    Leonard B

    That should do the trick:
    I put your values in variable, just replace the names, as
    needed
    <cfset birthdate = "11/15/45">
    <cfset ssn = "41646562121216654">
    <cfset lastname = "Smith">
    This deletes all the / from your birthday string (if it is a
    string!) and puts it into the id variable:
    <cfset id = replace(birthdate, "/", "", "All")>
    This takes the last 4 letters/digits of your social security
    number string and adds it to the id:
    <cfset id = id & right(ssn,4)>
    This takes the first thre letters/digits from your last name
    variable, puts it in upper case and adds it to the id string
    <cfset id = id & ucase(left(lastname,3))>
    Hope it helps.

  • My external hard drive will not open and only shows up in Disk Utilities. When I try yo repair it, it give me and error of invalid sibling link. How do I fix my external hard drive?

    My external hard drive will not open and only shows up in Disk Utilities. When I try yo repair it, it give me and error of invalid sibling link. How do I fix my external hard drive?

    Invalid sibling link may not be fixable by Disk Utility. (Disk Utility is very conservative, and will not attempt repairs that might cause you to lose data.)
    It is an indication of serious Directory damage.
    that leaves
    a) third-party Utilities that will take those risks, or
    b) re-initializing the drive (which deletes all your data) and restoring from another backup source.
    c) "Copying off whatever files you can salvage" has gone by, and you cannot copy anything off a drive that will not mount. You may be able to use "rescue" programs such as prosoft engineering Data Rescue to copy files to another drive, but that sounds a lot better than its reality. You may get many files, but not get ANY filenames.

  • How to show korean fonts/characters on 5800xm?

    how to show korean fonts/characters on 5800xm?

    @drenstin
    Perhaps have a look here:http://forum.dailymobile.se/index.php?action=printpage;topic=15893.0
    Happy to have helped forum with a Support Ratio = 42.5

  • HT2486 My mail account is linked to my address book. The address book shows First Name, Last Name. When I try to insert a name into an email, the order is reversed...Last Name, First Name.  How can I make the email read in the same order...First Name, Las

    My Mail Account in linked to my address book. The address book shows First Name, Last Name. When I start an email in Mail, the name does appear but the order is reversed...Last Name, First Name. I must have changed a setting somewhere but I don't know where. Does anyone know how to correct it?

    I don't have any problem with my system. My guess is there is something there you aren't quite getting. I'd recommend a visit to your Apple Store, AASP or to contact AppleCare so they can coach you personally.
    You can also play with the Address Book Preferences. However to see how changing a Preference affects the Address Book drag the Preferences window off of the Address Book so you can see both the Preferences window and Address Book Windows. Then toggle a Preference and you will see it instantly changes in the Address Book. 

  • How do I show the details of a customer when they are logged in a secure zone?

    How do I show the details of a customer when they are logged in a secure zone?
    I want to show the customer details as well as some customer CRM fields that are applied to the customer. None of these are entered via a form, they would be entered by the client. The customer would need to be able to log in to view the information and get an email alert when it is updated. Help!?

    Hi,
    You might want to look into customer service zones which allows customers once logged in to see their case, order and own details. 
    - http://kb.worldsecuresystems.com/133/bc_133.html
    - http://kb.worldsecuresystems.com/kb/customer-service-area-orders.html
    - http://kb.worldsecuresystems.com/kb/allowing-customers-view-update-crm.html
    Kind regards,
    -Sidney

  • Photoshop Elements 8, How to show  hue, value and saturation of a specific area of a pickture?

    Hello,
    Photoshop Elements 8, How to show  hue, value and saturation of a specific area of a picture?
    How should I select the area? Which tool?
    Thank you in advance, Karl

    First make sure your Info Palette is visible : menu Window / Info (shortcut F8)
    In this palette, click the small     icon 'more'
    Choose 'Palette Options'
    and choose HSB for the second palette readout.

  • How to keep first form window state maximize when you called the second for

    HI,
    how to keep first form window state maximize when you called the second form ?
    Thanks

    Here is sample of doing this.
    Chris

  • IMesssage has stopped using my cell phone number and is only showing email addresses -- in other words, when I text, it is showing up as coming from an email address, even when i use my phone.   Laptop

    iMesssage has stopped using my cell phone number and is only showing email addresses -- in other words, when I text, it is showing up as coming from an email address, even when i use my phone.   The laptop and phone are still synchronized and messages are showing on both devices.
    I've seen this before and was able to fix in Settings, but that is not working now.
    Please help.  Thanks.

    Did you replace your iPhone with some other kind of phone? If your phone number is no longer connected to an active iPhone, you can't use it to message from your Mac.

  • [svn] 4901: Only remove the children from the textFlow when they are going to be immediately replaced .

    Revision: 4901
    Author: [email protected]
    Date: 2009-02-09 09:27:39 -0800 (Mon, 09 Feb 2009)
    Log Message:
    Only remove the children from the textFlow when they are going to be immediately replaced. Side effect from SDK-18880.
    QE Notes:
    Doc Notes:
    Bugs: SDK-19177
    Reviewers: Gordon
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18880
    http://bugs.adobe.com/jira/browse/SDK-19177
    Modified Paths:
    flex/sdk/branches/i10/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as

    This is a problem of overall design.  It is not a scripting issue.
    NET USE wil only delete the drive you tell it to delete.  You will need to know in advance which drive that is.  There is no magic in WIndows.  YOu must tel it everything.
    Bill suggests GPP which is very easy to use and very flexible.  It avoids learning how to write scripts and understand much of Windows.  Just set the values and they do allof this for you.  There are checkboxes for most issues.
    Most of us have not mapped drives since shortly after the release of Vista many years ago.  Save your self a lot of headaches and use the tools that were built to do this/
    ¯\_(ツ)_/¯

  • In Mountain Lion how does OS select between ethernet and WiFi when both are activated??

    In Mountain Lion how does OS select between ethernet and WiFi when both are activated??  How does OS use "both" networl accesses??

    It will pick the highest service in the list which has an internet connection.
    To order the list, open Network System Preferences and select Set order of network services from the button below the service list.

  • How can I get rid of app upgrades, when I no longer have the app?

    How can I get rid of app upgrades , when I no longer have those particular apps?

    If the app is no longer installed on the iPad then you should get prompts about updates to it in the App Store app - as efectively there is nothing for it to update. If you are being prompted to download updates to them then are you sure that they are no longer on the iPad ?
    If you are being prompted on your computer's iTunes then if you delete them for the App part of you computer's Library then you shouldn't be prompted about them.

  • How to calculate the salary of the employees when they are differentiated by monthly and hourly basis

    Hi all
    How to calculate the salary of the employees when they are differentiated by monthly and hourly basis
    How can we write the logic though sql
    Thanks in advance

    (case when pay_basis like 'HOURLY'
    then PROPOSED_SALARY_N*pay_annualization_factor
    when pay_basis like 'ANNUAL'
    then PROPOSED_SALARY_N*pay_annualization_factor
    end )
    I was actually trying to write the logic in this way but it was not calculating in correct format for hourly paid employees

  • How to fix keyboard clicks and lock sounds when they are on in setting , sounds and still do not work?

    How to fix keyboard clicks and lock sounds when they are on in setting , sounds and still do not work?

    Double-click the Home button and swipe the Task Bar to the right. Check Volume and Mute Settings.
    Message was edited by: Diavonex

  • Need JavaScript to Reference another Textfield, but only need first 2 characters to show.

    I am creating a form in Adobe Pro X and when info is entered into TextField1, I need the first 2 characters to automatically show up in TextField2.  I have already limited my characters to 2 on TextField2 properties, but need a javascript to reference the TextField1.  If setting the character limit in properties will not work with this javascript, please add that as well.  Thank you.

    Use this code as the custom calculation script of TextField2 (You can remove the character limitation, it's not required):
    event.value = this.getField("TextField1").valueAsString.substring(0,2);

Maybe you are looking for

  • N97 Fm transmitter BUG

    Hello i'm the owner of a nokia n97,laster sofware version 21.0.0.045v.I can't activate the fm transmitter.I selecte it and it asks me if i want to activate it (yes/no )but i select yes and nothing i mean nothing happens it just stays turned off is it

  • EBS Tables for the OBI Tables.

    HI EveryOne, We have a quick requiremnet, for that we have to find the EBS tables to the corresponding OBI tables and their columns are below. <font color="Blue">W_GL_ACCOUNT_D </font> GROUP_ACCOUNT_NUM <font color="Blue">W_GL_OTHER_F </font> GLOBAL1

  • PAAH adhoc query  - download to MS Excel

    Dear All I am using tcode paah to to calla query and generate a report,its working fine when i try to download that report in to Microsoft excel ot shows a downmloaded excel with empty sheet with no data trasfered,but when i use save as local file an

  • Displaying image on welcome view

    Hi Gurus!     I need to display image document stored on server on welcome view. For that, I have added MIME object after Importing that image. Then, created image in RootUIElementContainer of 'Welcome View' and does the mapping in context tab. After

  • How to make an unmodifiable text field

    Can someone let me know what the html code is for an unmodifiable text field?