Results 1 to 3 of 3
  1. #1
    DerekW is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2021
    Posts
    5

    Lightbulb Building a query to pull data for a specific request


    Hello,

    I am struggling to figure out how to create queries in Access to pull data according to the request below. Can someone please help me out or point me in the right direction on creating the necessary queries? The request is below and I have attached a sample database of data to use for reference.

    Data Request:
    For the days when there is a transaction using an MCC code that contains the words hotel, motel, resort or inn, return all transaction details about any transactions for those days that also contain MCCs that have the words food or restaurant.


    Thanks
    Derek
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Code:
    SELECT Transactions.ID, Transactions.AgencyNumber, Transactions.AgencyName, Transactions.CardholderLastName, Transactions.CardholderFirstInitial, Transactions.Description, Transactions.Amount, Transactions.Vendor, Transactions.TransactionDate, Transactions.PostedDate, Transactions.MCC
    FROM Transactions
    WHERE ((((Transactions.MCC) Like "*HOTEL*" Or (Transactions.MCC) Like "*MOTEL*" Or (Transactions.MCC) Like "*RESORT*" Or (Transactions.MCC) Like "*INN*") And ((Transactions.MCC) Like "*Restaurant*" Or (Transactions.MCC) Like "*Food*")));

  3. #3
    DerekW is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2021
    Posts
    5
    Thanks!! This helped me out.

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

Similar Threads

  1. Replies: 6
    Last Post: 06-15-2018, 12:37 PM
  2. Replies: 2
    Last Post: 08-22-2014, 12:02 PM
  3. pull data from a specific record in a subform
    By pleshrl in forum Queries
    Replies: 3
    Last Post: 04-21-2013, 05:07 AM
  4. Code to pull in data from a specific record
    By jdunn36 in forum Access
    Replies: 1
    Last Post: 09-20-2010, 11:54 AM
  5. Replies: 2
    Last Post: 08-29-2010, 12:30 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