Alpha Video Training
Results 1 to 5 of 5

Thread: Calculated field is truncated in a form

  1. #1
    Member
    Real Name
    Joe Hakim
    Join Date
    Aug 2009
    Posts
    2

    Default Calculated field is truncated in a form

    Hi, I've been using Alpha 4, and 5v1 for years and now I have been trying to use an expression to concatenate an address field based on whether there is a "c/o" expression in the address. When I evaluate the expression it is correct, however in the form it truncates it even though I have changed the form field properties to a larger value than it needs. Here is the expression:
    IF( ISBLANK( "ADDRESS2" ) , ADDRESS1 ,IF(LEFT( ADDRESS1 , 3)="c/o", TRIM(ADDRESS1)+", "+TRIM(ADDRESS2), ADDRESS2 ))

    Basically if there is no 2nd address for the customer, then it will print just what is in Address1 field, or it will print the Address2 field for the address (assuming Address 1 would be a business name) BUT if the Address2 is in C/O someone I want the c/o address in there plus the address2 field together separated by a comma. BUT when I save the form it cuts off the characters after the 31st character, even though it is a 40 character field.

    I'm sure it has to do with field length of the expression somehow but not sure how to force it to show the rest of the character - any help would be appreciated - thank you.

  2. #2
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Calculated field is truncated in a form

    Hi Joe,
    Did you also check the width of the field within the table itself? Yep--sure looks like you did on rereading.....Try adding alltrim to every field in the expression just to be sure....could even expand the table field as an experiment to see if more characters show up...
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  3. #3
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Calculated field is truncated in a form

    I seem to remember way back when..............

    if you had an if() returning a character value the length of the returned value was controlled by the final parameter.

    IOW the expression

    if(logical expression,"some text here","none")

    would return "none" if the logical test returned false (four characters)
    would return "some" if the logical test returned true (four characters)

    the expression

    if(logical expression,"some text here","no text in the variable tested")

    would work as desired because the final parameter string was longer.
    There can be only one.

  4. #4
    Member
    Real Name
    Joe Hakim
    Join Date
    Aug 2009
    Posts
    2

    Default Re: Calculated field is truncated in a form

    I DID IT I DID IT!! Thanks for the help - I tried your idea Stan but that didn't seem to make a difference, BUT if I added padding to the other expression with a bunch of spaces it worked! Here was my final expression that worked - it must have to do with character length of each field value...
    IF( ISBLANK( "ADDRESS2") , ADDRESS1, IF(LEFT( ADDRESS1 , 3) = "c/o", TRIM(ADDRESS2)+", "+TRIM(ADDRESS1), ADDRESS2+" <more than 2 blank spaces> don't seem to show up when I post here so I added this text "))

    Thanks again guys, this was making me nuts ~:-)
    Last edited by powerjam; 08-15-2009 at 03:30 PM. Reason: Blank spaces in my expression weren't showing in the post.

  5. #5
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Calculated field is truncated in a form

    Glad you found a solution.

    Regarding
    Blank spaces in my expression weren't showing in the post.
    If you use the Advanced reply there is a # icon that when code is highlighted and this icon pushed, will add code tags around your code--it will preserve spaces, indents, etc..
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




Similar Threads

  1. Truncated Field Names
    By Beltronics in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 07-08-2008, 10:11 PM
  2. Truncated Field Names
    By djones092 in forum Alpha Five Version 5
    Replies: 6
    Last Post: 04-30-2003, 08:37 AM
  3. Truncated Field Names (:<<((((
    By forskare in forum Alpha Five Version 4
    Replies: 5
    Last Post: 05-05-2002, 05:54 AM
  4. Truncated numeric field
    By cawalton1 in forum Alpha Five Version 4
    Replies: 2
    Last Post: 11-19-2001, 04:37 AM
  5. Truncated-indexes & truncated-fields
    By Robert Carolina in forum Alpha Five Version 4
    Replies: 4
    Last Post: 07-13-2001, 12:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •