Results 1 to 3 of 3
  1. #1
    nightwing60 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    1

    Data Type Mismatch in criteria expression - adding a third query

    I added a third query to a query with an outer join and now I get an error message: Data Type Mismatch in criteria expression.
    I thought perhaps it was something to do with the 3rd query so to test; I removed one of the queries that was working and kept the new query, and it worked fine. It is only when I add my third query...two queries (does not matter which two queries I keep) it works as it suppose to work.

    The SQL is as follow
    SELECT [ATT Supplier] & [Test Supplier] & [Verizon Supplier] AS Supplier, Sum([ATT Charge] & [verizon charge] & [test charge]) AS [Supplier Charge], CircuitData.Grouping, CircuitData.cust_name, CircuitData.ptt_bill_refid, CircuitData.[Billing Acct#], CircuitData.Type, CircuitData.ptt_name, CircuitData.orion_order_refid, CircuitData.orig_site_address, CircuitData.citya_name, CircuitData.countrya_name, CircuitData.term_site_address, CircuitData.cityb_name, CircuitData.countryb_name, CircuitData.cct_order_mthly_amt, CircuitData.validation_comments
    FROM ((CircuitData LEFT JOIN [CircuitChargeSummary-ATT] ON CircuitData.ptt_bill_refid = [CircuitChargeSummary-ATT].[ATT Circuit]) LEFT JOIN [CircuitChargeSummary-Verizon] ON CircuitData.ptt_bill_refid = [CircuitChargeSummary-Verizon].[Verizon Circuit]) LEFT JOIN [CircuitChargeSummary-TestData] ON CircuitData.ptt_bill_refid = [CircuitChargeSummary-TestData].[Test Circuit]
    GROUP BY [ATT Supplier] & [Test Supplier] & [Verizon Supplier], CircuitData.Grouping, CircuitData.cust_name, CircuitData.ptt_bill_refid, CircuitData.[Billing Acct#], CircuitData.Type, CircuitData.ptt_name, CircuitData.orion_order_refid, CircuitData.orig_site_address, CircuitData.citya_name, CircuitData.countrya_name, CircuitData.term_site_address, CircuitData.cityb_name, CircuitData.countryb_name, CircuitData.cct_order_mthly_amt, CircuitData.validation_comments
    ORDER BY [ATT Supplier] & [Test Supplier] & [Verizon Supplier];

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Check that the fields being joined on are of compatible data types. It also seems odd you're using "&" in the Sum(); I'd expect "+".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Like Paul said, must be data types. I pasted your SQL in a new qry and was able to get it to work just fine. No errors for me. All data fields I created are text with the exception of the fields in sum.

    .
    Click image for larger version. 

Name:	qryTest.jpg 
Views:	10 
Size:	65.7 KB 
ID:	14831

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

Similar Threads

  1. Replies: 4
    Last Post: 05-17-2013, 04:00 PM
  2. Data Type Mismatch in Criteria Expression
    By dehdahdoh in forum Queries
    Replies: 13
    Last Post: 05-01-2013, 11:41 AM
  3. Data Type mismatch in criteria expression
    By elb1999 in forum Queries
    Replies: 2
    Last Post: 01-20-2012, 02:38 PM
  4. data type mismatch in criteria expression
    By broecher in forum Access
    Replies: 4
    Last Post: 09-10-2010, 08:29 AM
  5. Data type mismatch in criteria expression
    By shexe in forum Queries
    Replies: 2
    Last Post: 09-01-2010, 12:47 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