Results 1 to 4 of 4
  1. #1
    DaveT99 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    76

    insert a single character (-) in a string

    I would like to insert a (-) after the 4th character. My query SQL is



    SELECT Master_MPN.Std_MPN, Master_MPN.Std_Part_Desc, Master_MPN.Std_Mfr
    FROM Master_MPN
    WHERE (((Master_MPN.Std_Part_Desc) Like "*PHOTO*") AND ((Master_MPN.Std_Mfr) Like "SICK*"));

    the field requiring the inserted character is Master_MPN.Std_MPN

    Many Thanks
    dave

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Use Left() and Mid() functions?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    =left([field],4) & "-" & mid([field],5)

  4. #4
    DaveT99 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    76
    Many thanks Ranman256, worked perfectly
    Tks Again for the quick reply
    Dave

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

Similar Threads

  1. Replies: 3
    Last Post: 07-20-2020, 01:04 PM
  2. Replies: 5
    Last Post: 05-10-2017, 12:10 PM
  3. Replies: 2
    Last Post: 04-05-2015, 06:06 PM
  4. How do I return last character in a string?
    By SSgtBarry in forum Queries
    Replies: 4
    Last Post: 06-22-2014, 08:10 PM
  5. Single character fields through memos
    By whiskers197u8 in forum Import/Export Data
    Replies: 3
    Last Post: 12-07-2012, 07:14 PM

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