Results 1 to 5 of 5

Thread: SQL Problem??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Posts
    87

    Question

    Greetings..

    I have a problem with my sql. When i run the qeury it returns a "Type mismatch in expression" error.

    Here's the code for your reference :

    Code:
    SELECT [Tutorials].[TutorialID], [Tutorials].[TutorialTitle], [Tutorials].[AuthorID], [Tutorials].[DatePosted], [Tutorials].[CourseID], [Teachers].[TeacherID], [Teachers].[LastName], [Courses].[CourseID], [Courses].[CourseName], [Courses].[CourseLevel]
    FROM Courses INNER JOIN (Teachers INNER JOIN Tutorials ON [Teachers].[TeacherID]=[Tutorials].[AuthorID]) ON [Courses].[CourseID]=[Tutorials].[CourseID];
    Is there anything wrong with the code? What I am trying to do is open a recordset that 3 tables has relations in.

    Thanks for any help in advance.

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    When you specify a join between two tables in a SELECT statement, the field data types must match.
    Check that the following fields are the same type:
    Teachers.TeacherID & Tutorials.AuthorID
    Courses.CourseID & Tutorials.CourseID

    The easiest way to check for a valid statement is in MSQuery (packaged with Excel), SQL Server Query Analyzer or use the Access Query builder.
    This will identify this sort of problem before you get into code.
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Posts
    87
    Thanks for all the reply guys..
    another question. I have problem declaring the 'memo' datatype in ASP. I am using Ms Access for my database.
    Anybody can help me with this please by providing me the code for it please..?

  4. #4
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    In VBScript it is Dim myMemo
    In JScript it is var myMemo
    No need for anything else.
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Posts
    87
    i have solve that problem already thanks..
    now i have another.. does memo reads the enter command?
    i mean lets say the memo is made of several lines separated by the 'enter' thing.
    Will the asp reads it as enter too displaying the same layout as in the database?

    Thanks in advance.

Posting Permissions

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



Click Here to Expand Forum to Full Width