Results 1 to 12 of 12
  1. #1
    SuicidalDriver is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    5

    concatenation issue

    Hello,



    I can't seem to get my concatenation query to work, I need it to take the separate parts of the address and put them into one field

    This is what I have:
    CAddress1: [CStreetNumber1] & " " & [CStreetName1] & " " & [CSuburb1] & " " & [CCity1] & " " & [CPostCode1]


    Any help would be greatly appreciated


    Thanks
    Andy

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    In what way does it not work. What is wrong with the the data that is returned.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    SuicidalDriver is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    5
    It only shows the field name (CAddress1) when I push run, so it doesn't actually return data

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Perhaps some of your fields contain Null values. What result do you get if you use:
    CAddress1: Nz([CStreetNumber1],"") & " " & Nz([CStreetName1],"") & " " & Nz([CSuburb1],"") & " " & Nz([CCity1],"") & " " & Nz([CPostCode1],"")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    SuicidalDriver is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    5
    If I use the above it just shows the same thing, I've also just checked the fields I'm trying to concat and they all have a value in them.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    What do you get if you try:
    CAddress1: Nz([CStreetNumber1],"")
    And what do you get if you try:
    CAddress1: Nz([CStreetNumber1],"") & " " & Nz([CStreetName1],"")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Post the entire query SQL statement for analysis.

    I see nothing wrong with the original syntax. Strings should still concatenate even if any fields are null.
    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.

  8. #8
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Quote Originally Posted by SuicidalDriver View Post
    Hello,

    I can't seem to get my concatenation query to work, I need it to take the separate parts of the address and put them into one field

    This is what I have:
    CAddress1: [CStreetNumber1] & " " & [CStreetName1] & " " & [CSuburb1] & " " & [CCity1] & " " & [CPostCode1]


    Any help would be greatly appreciated


    Thanks
    Andy
    Are you trying to display it in the form?

  9. #9
    SuicidalDriver is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    5
    currently im just trying to get it to display the concatenated field when I press run, this image shows the query in design view
    .Click image for larger version. 

Name:	screeny.png 
Views:	22 
Size:	12.8 KB 
ID:	13259

  10. #10
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    You can switch view to have the full SQL statement using upper left icon (left of the red !) and selecting SQL view.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Only the one table (no joining) in the query, then that expression should work.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  12. #12
    SuicidalDriver is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    5
    thanks for the help, and the tip about viewing the full sql statement, it helped a lot, turned out what the issue was is it had "FROM customer, job;" when it should have been "FROM customer;" I changed that and it's fixed it

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

Similar Threads

  1. Two-color concatenation?
    By KDTom in forum Forms
    Replies: 2
    Last Post: 02-01-2013, 03:13 PM
  2. Concatenation
    By Rhubie in forum Access
    Replies: 3
    Last Post: 08-30-2012, 05:09 PM
  3. Field concatenation
    By Trojnfn in forum Access
    Replies: 1
    Last Post: 10-10-2011, 05:56 PM
  4. Query and Concatenation
    By Try2Live4God in forum Programming
    Replies: 2
    Last Post: 05-25-2010, 03:45 PM
  5. Concatenation Urgent Help
    By Shoaib in forum Queries
    Replies: 0
    Last Post: 04-23-2009, 11:02 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