Results 1 to 6 of 6
  1. #1
    Ksinay is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    9

    query that joins and expression to a table data type mismatch

    I have table(table1) RxNum that is set as a number and each entry has 11 numbers. I only need the first 8. I made a query (query1) to take the last 3 digits off. I have another table (table2)with that has the RxNum with the required 8 digits so I can find the matches. I made a second query (query2) that includes query1 and table2 to match the RxNum fields. I get a "type mismatch in expression". I have been trying to figure out how to change the expression in query2 to convert to a number but I cant figure out. I don't know code but could try if that is the only way to fix the expression to yield the results as a number.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    When is a number not a number? When it is in a text type field.

    It sounds like one field is a text type field and the other is a numeric field (Integer/Long/Single or Double).

    In Query1, maybe try:
    Code:
    Val(Left(RxNum,8))

  3. #3
    Ksinay is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    9
    YEEEESSSSS!!!!! I have been searching on-line for 2 hours. THANKS!

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Great..

    Ready to mark this solved?

  5. #5
    Ksinay is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    9
    Yes, I am new to this.. where do you select that option

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Top of the page... Thread Tools (in (2nd) the green bar)

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

Similar Threads

  1. Replies: 1
    Last Post: 07-24-2014, 08:35 PM
  2. Data type mismatch in criteria expression
    By khughes46 in forum Queries
    Replies: 12
    Last Post: 05-01-2014, 07:34 AM
  3. Replies: 2
    Last Post: 12-21-2013, 11:37 AM
  4. Replies: 4
    Last Post: 05-17-2013, 04:00 PM
  5. Data type mismatch in criteria expression
    By Douglasrac in forum Forms
    Replies: 3
    Last Post: 11-23-2010, 10:46 AM

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