Results 1 to 4 of 4
  1. #1
    fajardok is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    4

    Combing 5 columns into one, some have blank fiels


    I would like to take 5 columns (Addr Number, Addr Suffix, Addr Prefix, Addr Street Name, Addr Street Type) and create one column. Some of the columns are blank and have Null values. I am struggling with the right code for this. Please help

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Welcome to the forum!

    I'm not sure what you want to do with the null fields or what format you want, but the let's say that you want each field separated by a space. That would look like this (in a query):

    SELECT [Addr Number] & " " & [Addr Suffix] & " " & [Addr Prefix] & " " & [Addr Street Name] & " " & [Addr Street Type] as FullAddress
    FROM tablename

    If you do not do anything to handle the null fields then you would just have a few extra spaces.

    By the way, I generally recommend that you do no have spaces or special characters in your table or field names. It would save having to enclose the names in square brackets.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    [Addr Number] & " " + [Addr Suffix] & " " + [Addr Prefix] & " " & [Addr Street Name] & " " + [Addr Street Type]

  4. #4
    fajardok is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    4
    That works! Ok, So here is another one if you would like to take it on....
    I have to create a mailer, but my data base is seperated by individual. I dont want to send 4 mailers to the same house. (4 people live there)
    How do I create a report/label/whatever for each mailing address, not person.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-08-2012, 03:04 PM
  2. Comparing 2 columns against 2 other columns
    By Amadeus in forum Access
    Replies: 4
    Last Post: 06-09-2011, 02:48 PM
  3. Replies: 4
    Last Post: 05-11-2011, 03:06 AM
  4. Primary key multiplynig in blank columns
    By desiinusa123 in forum Queries
    Replies: 0
    Last Post: 03-12-2009, 04:29 PM
  5. Replies: 1
    Last Post: 09-05-2008, 12:07 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