Results 1 to 7 of 7
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    concatinate fields

    Hi

    apologies if this is a double post , thought I had submitted it but can't see it in the forum.

    I have two fields I am trying to concatinate



    1. dateofdeath which is format text dd-mmm

    2. Yearofdeath which has two formats one yyyy/yy ( 1856/57) and the second is just yyyy

    I need to create a third field by concatination format dd-mm-yyyy BUT whilst using the format yyyy is not a problem the format yyyy/yy presents a difficulty. I need to use the first 2 and last 2 characters ie end up with the year as 1857 ( in the example above)

    Can this be done?

    thanks

    Ian

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Use string manipulation functions.

    dateofdeath & "-" & Left(Yearofdeath,2) & Right(Yearofdeath,2)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Quote Originally Posted by June7 View Post
    Use string manipulation functions.

    dateofdeath & "-" & Left(Yearofdeath,2) & Right(Yearofdeath,2)
    THanks I'll try it later


    Ian

  4. #4
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    clarification

    Hi

    many thanks that worked perfectly - something else to read up on "string Manipulation Functions" ;-)

    Just an additional question if I may. A search on google brings up several pages suggesting that using a calculated field in a table is a bad idea so which is better table level or form level or is it as I suspect dependent on other things such as how you are going to use the form?

    In my case it is simple used for data display so I have used it in the table.

    thanks Ian -so much to learn and so little time

  5. #5
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    The best place for calculations is actually a query. Ther query is based off of your table. You can then base your form off of the query instead of the table, so it will have all those calculations available to you.

  6. #6
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    THanks for the info

    Ian

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Although I have not used, as far as I can see nothing really wrong with Calculated field in table for simple calcs, unless there is a chance of migrating to another platform like MySQL or SQLServer, then they will be an issue as would multi-value and Attachment fields.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 04-24-2016, 07:24 AM
  2. Concatinate autonumber
    By deepucec9 in forum Access
    Replies: 11
    Last Post: 10-22-2015, 05:52 AM
  3. Replies: 8
    Last Post: 08-02-2012, 10:50 AM
  4. Replies: 12
    Last Post: 05-07-2012, 12:41 PM
  5. Concatinate data from seperate table
    By ntonline in forum Forms
    Replies: 2
    Last Post: 01-28-2011, 11:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums