Results 1 to 8 of 8
  1. #1
    hnorgaar is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    19

    Query criteria I think

    In a table I have several records with duplicates based on 1 field. Here is examples. Thx for any input.
    I was thinking to have a translation table, but so far Im having troubles with empty fields or null maybe

    Record 1 "With sugar"
    Record 1 (Duplicate) Empty or "Not with sugar"
    Record 2 "With jam"
    Record 2 (Duplicate) Empty
    Record 3 "With sugar"
    Record 3 (Duplicate) "With jam"

    My result in a query should be identical for both records to reduce records by using unique values

    Record 1 "With and without sugar"
    Record 2 "With and without jam"


    Record 3 "With sugar and jam"

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    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
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Are the records exactly as you show them here? Meaning do they always start with "With" (or "Not with") and have one extra word which is the attribute?
    You can easily deal with nulls using the Nz function Record 2 Nz([YourField],"Without"). Then you would use one of the available concatenating function (recently I like theDBguy's SimpleCSV http://www.accessmvp.com/thedbguy/co...itle=simplecsv) to merge them into one record, with probably some more string manipulations needed.

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    hnorgaar is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    19
    No they are not, just eamples, but the issue is to find records where only 1 field in the records differ with text empty or a list of 6-7 different texts, and then change the text to reduce records in the query. In excel I made a point system to find them, using empty as 1 and different texts 10, 105, 1005 and so on, and summed them up, giving all with 106 would be "With and without something", as that will equal 105 + 1, empty plus a text "something" with lookup and if sum is 105, that will be original text

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    So use the SimpleCSV along with Nz() to get a list in one record (you can use " and " as the delimiter).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    hnorgaar is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    19
    Dont think I can, I have attached a spreadsheet with the texts im looking for and the point system im using, and row A is the original texts I need to seperate in a query WHEN they are duplicates except for the row these texts are in, and the texts in row E is the new combined text I will like to replace both duplicates with. Its a base for car spare parts and to avoid the custemer to see the same article 2 times because it fits the same car with manual and automatic gear, whereas other articles from same group doesnt

    Sorry the text is in DK
    Attached Files Attached Files

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Have you tried to create a totals query grouping the the record id and summing using your same point system. Then create a lookup table with your final texts (column E) and link that to the sum field. It would help if you can upload a sample db with the actual table, not an Excel file.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    hnorgaar is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    19
    Yes I did but I will try again as I gave up first time and maybe with NZ I can get it to work. If not I will return with new questions from that base. Thx

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

Similar Threads

  1. Replies: 1
    Last Post: 08-17-2020, 10:10 AM
  2. Replies: 2
    Last Post: 04-02-2015, 12:45 PM
  3. Replies: 4
    Last Post: 08-30-2014, 10:23 AM
  4. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  5. Replies: 1
    Last Post: 07-13-2011, 11:00 AM

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