Results 1 to 4 of 4
  1. #1
    bigspace55 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    11

    Expression too complex error

    So, I've been using my DB for about a month or so now and it has been working fine. Then, all of a sudden I get hit with this error when I try to open up one of my queries. I'm pretty sure I need to do something with setting Parameters but I'm not sure what or how to do it. Here is the SQL of the query.




    SELECT [TC12 Data with month and year].[Technician Name], [TC12 Data with month and year].MA, [TC12 Data with month and year].account_number, [TC12 Data with month and year].wo_type, [TC12 Data with month and year].create_date, [TC12 Data with month and year].le_work_order_number, [TC12 Data with month and year].work_order_number, [TC12 Data with month and year].last_event_wo_type, [TC12 Data with month and year].last_event_close_date, [TC12 Data with month and year].days_between, [TC12 Data with month and year].customer_lname, [TC12 Data with month and year].current_scheduled_date, [TC12 Data with month and year].total_tc_within_60_days, [TC12 Data with month and year].[Month Number], [TC12 Data with month and year].[Month of], [TC12 Data with month and year].[Year of]
    FROM [TC12 Data with month and year]
    WHERE ((([TC12 Data with month and year].[Month of])=[Forms]![Reports by selected month and/or office]![Month of]) AND (([TC12 Data with month and year].[Year of])=[Forms]![Reports by selected month and/or office]![Year of]));

    In this statement, the TC12 Data with month and year is a query that has a list of data with expressions in it giving the month number, month name, and year of for each row of data since all of them have a date with them. In the query that has a problem, as you can see, I am trying to pull from that query the same data but where the month and year are equal to what I have selected on my forms.


    Thanks in advance!

    Had to edit this cause I put the wrong query sql in here...sorry. It's the right one now

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Can't see anything wrong with the query syntax. Could simplify:

    SELECT * FROM [TC12 Data with month and year] WHERE [Month of]=[Forms]![Reports by selected month and/or office]![Month of] AND [Year of]=[Forms]![Reports by selected month and/or office]![Year of];

    Does query [TC12 Data with month and year] open without error?
    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
    bigspace55 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    11
    Yes, [TC12 Data with month and year] opens fine. I tried doing what you said and it brought up the data for a second but then it popped up as "data type mismatch in criteria expression" and every single item on every row and field ends up switching from whatever it's supposed to be to "#Name?"

  4. #4
    bigspace55 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    11
    Hey June...Thanks for the help. It ended up being some data typed into the table it was pulling from was messed up and not any of the queries.

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

Similar Threads

  1. Replies: 4
    Last Post: 10-26-2012, 12:49 AM
  2. Expression to complex
    By Compufreak in forum Queries
    Replies: 5
    Last Post: 08-08-2012, 04:03 AM
  3. Replies: 1
    Last Post: 05-24-2012, 12:34 PM
  4. Replies: 3
    Last Post: 03-31-2011, 11:07 AM
  5. need help, expression is too complex?
    By ice673 in forum Queries
    Replies: 5
    Last Post: 02-15-2010, 09:03 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