Results 1 to 2 of 2
  1. #1
    Baalu is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    7

    Lightbulb Concatenating Fields Based On Repetition, Access 2010

    Hi Friends,

    I have a difficulty in writing a query, need your help on this.
    I don’t have any other base tables for this, I actually get this data from other departments in excel format. I am trying to automate my regular tasks using access. I import the data from excel to access as is and then writing queries to get the reports what I require.



    My requirement is - if I have same “ItemID” for same “OrderID” I should show the “ItemID” as “Department\ItemID” else only “ItemID” should be shown with all other information same. How can I achieve this? I actually provided the sample data here, actual data differs but the process is same.

    Result should be like





    Please help me in getting the solution.

    Thanks in Advance,
    Baalu

  2. #2
    Baalu is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    7

    complted using Dcount

    Hi All,

    Finally I found the solution for this.

    Here is the Query:

    SELECT MyTable.[Sl.No], MyTable.Department, IIf(DCount("*","[MyTable]","[ItemID]='" & [ItemID] & "' And [OrderID] = '" & [OrderID] & "'")>1,[Department] & "\" & [ItemID],[ItemID]) AS ItemID_Rev, MyTable.OrderID
    FROM MyTable
    ORDER BY MyTable.[Sl.No];

    Thank You All.

    Have a Nice Day..
    Last edited by Baalu; 03-12-2015 at 03:02 AM. Reason: Want to Tag it as Completed

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

Similar Threads

  1. Stuck on Access concatenating into string
    By orangeman2003 in forum Queries
    Replies: 6
    Last Post: 12-25-2013, 03:16 AM
  2. Replies: 5
    Last Post: 02-21-2013, 10:03 PM
  3. Replies: 12
    Last Post: 05-07-2012, 12:41 PM
  4. Concatenating fields from matching records
    By MWMike in forum Queries
    Replies: 1
    Last Post: 10-28-2010, 10:49 PM
  5. Concatenating many fields into one field
    By olidav911 in forum Programming
    Replies: 1
    Last Post: 08-13-2009, 05:14 AM

Tags for this Thread

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