What's wrong?

Results 1 to 3 of 3

Thread: What's wrong?

  1. #1
    Join Date
    Dec 1969

    Default What's wrong?

    Hi,<BR>I have an Access97 database for bikes.<BR>It contains the following tables...<BR><BR>bikes, makers, material, types <BR><BR>I use the following SQL to bring up a list depending on what type of bike the user wants to search for. <BR><BR>SQL="SELECT * FROM types INNER JOIN (material INNER JOIN (makers INNER JOIN bikes ON [makers].[bmanuid] =[bikes].[bmanuid]) ON [material].[bmatid] =[bikes].[bmatid]) ON [types].[btypeid] =[bikes].[btypeid]"<BR><BR>SQL=SQL & "WHERE bikes.btypeid =&#039" & btype &"&#039 " <BR> <BR>SQL=SQL & "ORDER BY bname"<BR><BR>The problem is, I get the error message below....<BR><BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e07&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. <BR><BR>Can anyone tell me what I&#039m doing wrong here???<BR> Many thanks in Advance....<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: What's wrong?

    Make sure bikes.btypeid is a character field since it&#039s delimited by single quotes. Also make sure both fields in each of your INNER JOINs are the same data type (eg. bikes.bmatid and material.bmatid are both character).<BR><BR>HTH

  3. #3
    David Highlander Guest

    Default Just to build on that

    He is saying that if your field type is an integer you need single quotes. If it is a character then double quotes will do.<BR><BR>You have single quotes around some of your fields.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts