Alpha Video Training
Results 1 to 12 of 12

Thread: How to remove first seven characters in a calculated field?

  1. #1
    Member
    Real Name
    Jim Gatton
    Join Date
    Jun 2006
    Posts
    35

    Default How to remove first seven characters in a calculated field?

    This seems as though it should be so simple but I'm missing something (maybe several things!) obvious. I did pull out my Alpha Tutorial and reference books from 1994 :-) in hope that I can find the answer tonight but maybe you can help me now.

    This is what I'm using in my calculated field.
    trim(NAME)+" "+rtrim(Url)+" "+trim(Tljunique)

    Below is a sample of the results that I am getting.
    John Smith http://www.whatever.com 66700CA

    My goal is to have the below instead with the http:// removed.
    John Smith www.whatever.com 66700CA

    Seems as though it should be such an easy thing to do but I'm clearly blanked at the moment.

    (Maybe this is why I should tweak my applications more frequently than once every five years?)

  2. #2
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: How to remove first seven characters in a calculated field?

    Strtran()
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: How to remove first seven characters in a calculated field?

    Slightly more long winded than Al's suggestion, but here you can see what is going on.
    Code:
    x="John Smith http://www.whatever.com 66700CA"
    
    ?x
    = "John Smith http://www.whatever.com 66700CA"
    
    q=left(x,at("http",x)-1)
    ?q
    = "John Smith "
    
    s=substr(x,at("http",x)+7)
    
    ?s
    = "www.whatever.com 66700CA"
    
    new=q+s
    ?new
    = "John Smith www.whatever.com 66700CA"
    Now you can make your own function and use it wherever you want.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  4. #4
    Member
    Real Name
    Jim Gatton
    Join Date
    Jun 2006
    Posts
    35

    Default Re: How to remove first seven characters in a calculated field?

    And then it came to me...
    trim(NAME)+" "+rtrim(ltrim(Url,"http://"))+" "+trim(Tljunique)
    So, thanks to you both!

  5. #5
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: How to remove first seven characters in a calculated field?

    Jim,

    I find it best to use ALLTRIM()
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  6. #6
    Member
    Real Name
    Jim Gatton
    Join Date
    Jun 2006
    Posts
    35

    Default Re: How to remove first seven characters in a calculated field?

    Keith, on your sayso I changed to ALLTRIM().

  7. #7
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: How to remove first seven characters in a calculated field?

    I would do this:

    ?alltrim(NAME)+" "+ a5_split_url(url).server +" "+alltrim(Tljunique)

    Because your URL might include https, http, or neither of those two.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  8. #8
    Member
    Real Name
    Jim Gatton
    Join Date
    Jun 2006
    Posts
    35

    Default Re: How to remove first seven characters in a calculated field?

    Steve, I never gave the https possibility a thought. Works great!

  9. #9
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: How to remove first seven characters in a calculated field?

    Jim

    I think this thread is in the wrong forum...

    What version of Alpha 5 are you using? I doubt you are using Alpha 4 if Steve's solution worked for you...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  10. #10
    Member
    Real Name
    Jim Gatton
    Join Date
    Jun 2006
    Posts
    35

    Default Re: How to remove first seven characters in a calculated field?

    You're right, Al. I scanned down and took note of "version 7 and 8" and thought I had the correct section. I'm actually running Alpha 5 version 7. Sorry everyone.

  11. #11
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: How to remove first seven characters in a calculated field?

    Quote Originally Posted by JimGatton View Post
    You're right, Al. I scanned down and took note of "version 7 and 8" and thought I had the correct section. I'm actually running Alpha 5 version 7. Sorry everyone.
    I'll more it to the appropriate forum...

    a5 v7 desktop
    or
    a5 v7 WAS

    ?
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  12. #12
    Member
    Real Name
    Jim Gatton
    Join Date
    Jun 2006
    Posts
    35

    Default Re: How to remove first seven characters in a calculated field?

    Desktop
    Version 7, Build 4130
    I was actually up to version 9 before my computer crashed but was only allowed to restore up to version 7 since version 9 was a gift. a free upgrade (hint - hint). But, it serves my purposes well.

Similar Threads

  1. Limits to characters in a calculated field?
    By draxx in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-29-2010, 06:22 PM
  2. Function to remove the first 3 characters of field
    By George Corder in forum Alpha Five Version 8
    Replies: 2
    Last Post: 10-10-2007, 06:05 PM
  3. How do I remove a Calculated field from DragDrop List
    By Luc Pilon in forum Alpha Five Version 7
    Replies: 2
    Last Post: 11-14-2006, 08:47 PM
  4. Remove old calculated fields?
    By JayMoskovitz in forum Alpha Five Version 4
    Replies: 3
    Last Post: 08-20-2001, 10:04 AM
  5. Remove Alpha Characters
    By Jerry Hartness in forum Alpha Five Version 4
    Replies: 4
    Last Post: 02-09-2001, 08:29 AM

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
  •