Results 1 to 4 of 4
  1. #1
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55

    Query Problem

    Hello,
    I want a query that works with parameters. When i put in outlet and month when prompted no data shows. see the attached file.


    Please Help
    Thx
    Dref

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    What format should the month be entered?

    Also in your Expression1, you had a formula error that was pushing out an additional parameter. change [publisher].[date] to [publisher],[date]

    Alan

  3. #3
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55
    Hello,
    It should be mmm,yyyy ( likeJanuary 2012).
    Publisher was a mistake. It should be tblbookings.
    Could u plz upload for me the one that works.
    Thx

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Here is the SQL statement to correct your query.

    In your primary table, you have the outlet linked to lookup table. You need to bring the lookup table into the query and use that as the source of the criteria for the name.

    Code:
    SELECT tblbookings.Date1, tblbookings.Product, tblbookings.Copies, tblbookings.Returns, tblbookings.Sales, tblbookings.Vendor_PX, tblbookings.Sales_Value, Format$(tblbookings.[Date1],'mmmm yyyy') AS Month1
    FROM tbloutlets INNER JOIN tblbookings ON tbloutlets.OutletID = tblbookings.OutLet
    WHERE (((Format$([tblbookings].[Date1],'mmmm yyyy'))=[Enter month in Format mmmm yyyy]) AND ((tbloutlets.Outlet) Like "*" & [Enter Outlet] & "*"));
    Additionally, there is no need to have an aggregate on this query when all you are doing is looking up by outlet. There is no aggregation going on.

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

Similar Threads

  1. Query problem! help! TIA
    By slam7053 in forum Queries
    Replies: 2
    Last Post: 07-21-2011, 02:59 PM
  2. Query problem
    By lamkee in forum Queries
    Replies: 13
    Last Post: 12-12-2010, 10:30 PM
  3. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM
  4. query problem
    By bhushan98 in forum Queries
    Replies: 1
    Last Post: 06-03-2009, 01:49 PM
  5. Problem in Query
    By Bruno Trindade in forum Queries
    Replies: 4
    Last Post: 03-28-2009, 04:10 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