Results 1 to 2 of 2
  1. #1
    scorpion99 is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Nov 2013
    Posts
    27

    Querying a specific text in a sentence

    Hi all,

    I have the following excel file (see attached). In the Main sheet , I have three categories that I would like to count each time they exists as value (See Summary sheet).


    I imported the Main sheet as table in my access, now I would like to do a query that allows me to get the results immediately.Can someone help?

    Mysheet.zip

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    This is not a normalized data structure. What you want won't be simple and could involve 5 queries to achieve the final result. But I will show them as one nested SQL:

    SELECT Data, Count(*) AS CountCat FROM (SELECT Main.ID, Main.Date, "Cars" AS Data FROM Main WHERE [Category] Like "*" & "Cars" & "*"
    UNION SELECT Main.ID, Main.Date, "Food" AS Data FROM Main WHERE [Category] Like "*" & "Food" & "*"
    UNION SELECT Main.ID, Main.Date, "Equipments" AS Data FROM Main WHERE [Category] Like "*" & "Equipments" & "*") GROUP BY Data;

    Each date/category should be separate records.

    Why were some rows hidden?
    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.

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

Similar Threads

  1. Querying specific weeks data within any given year?
    By McArthurGDM in forum Queries
    Replies: 1
    Last Post: 07-30-2014, 02:02 PM
  2. Replies: 7
    Last Post: 06-06-2013, 10:32 AM
  3. Replies: 2
    Last Post: 04-11-2013, 06:36 PM
  4. querying and converting text to numbers
    By hollyh in forum Queries
    Replies: 2
    Last Post: 09-01-2011, 12:39 PM
  5. Querying Multi Line Text Box in MS Access Forms
    By spindlebeakin10 in forum Queries
    Replies: 5
    Last Post: 12-09-2010, 05:50 PM

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