Results 1 to 5 of 5
  1. #1
    JRCharlie's Avatar
    JRCharlie is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2011
    Posts
    20

    How to combine two columns into one

    Hi all
    I have memo columns named column A and Column B.
    I'm trying to pickup the notes from column A and column B into column C seperated by "," .
    So far my query seams to work accept it does not check if column B is Null or not.
    Lets supose
    A B
    John Doe
    James

    Using my query I will get this result
    John,Doe
    James,

    How can I modify it to check if column B is Null or not because I do not want the "," as shown on the second line.
    This is what I have so far.



    Note: IIf(IsNull([RecheckNote]) Or [RecheckNote] Like "",[CTNote],[RecheckNote] & "," & [CTnote])
    Thanks in advanced

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Will there always be a value in column A (RecheckNote)? If not, then need to check for value in both columns and only use comma if there are both.
    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
    JRCharlie's Avatar
    JRCharlie is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2011
    Posts
    20
    Thanks June7 for your reply
    Column A and B both can be Null .
    or just A can have a value while B is null
    or B Can have a Value and A is null.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    [RecheckNote] & IIf(Not IsNull([RecheckNote]) And Not IsNull([CTNote]), ",","") & [CTNote]
    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.

  5. #5
    JRCharlie's Avatar
    JRCharlie is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2011
    Posts
    20
    Thank you June7 It works just I wanted

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

Similar Threads

  1. To combine and sum in a query
    By mdnikki in forum Queries
    Replies: 7
    Last Post: 11-08-2012, 12:50 PM
  2. combine two tables into one.
    By chad740 in forum Access
    Replies: 2
    Last Post: 08-31-2012, 01:12 PM
  3. Replies: 2
    Last Post: 05-17-2012, 03:52 PM
  4. Comparing 2 columns against 2 other columns
    By Amadeus in forum Access
    Replies: 4
    Last Post: 06-09-2011, 02:48 PM
  5. If columns are similar combine?
    By westcoastbmx in forum Queries
    Replies: 0
    Last Post: 09-04-2009, 12:54 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