Print Page | Close Window

Data type mismatch in criteria expression

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1870
Printed Date: 29 March 2026 at 8:42am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Data type mismatch in criteria expression
Posted By: skincla
Subject: Data type mismatch in criteria expression
Date Posted: 17 April 2003 at 8:52am

I have an Access database with these tables and settings:

Keyword
* Keyword_ID (Autonumber)
Keyword (text)

DocumentKeyword
* Document_ID (long integer)
* Keyword_ID (long integer)

Document
* Document_ID (Autonumber)
Title (text)
Author (text)
Location (text)

DocumentTopic
* Document_ID (long integer)
* Topic_ID (long integer)

Topic
* Topic_ID (Autonumber)
Topic (text)

UserTopic
* User_ID (long integer)
* Topic_ID (long integer)

User
* User_ID (Autonumber)
Username (text)
Password (text)
Security_ID (text)
Email (text)

Then I set up a query table which made the SQL code:

SELECT [Document].[Document_ID], [Topic].[Topic_ID], [Document].[Title], [Document].[Author], [Document].[Location], [Topic].[Topic]
FROM (Document INNER JOIN DocumentTopic ON [Document].[Document_ID]=[DocumentTopic].[Document_ID]) INNER JOIN Topic ON [DocumentTopic].[Topic_ID]=[Topic].[Topic_ID];

I am concerned about the square brackets (or whatever they are called), when I take them out they appear again next time I open the query.

Anyway all the ASP pages that use this query say "Data type mismatch in criteria expression"

Any pointers would be much appreciated.
Thanks
Sara




Replies:
Posted By: MorningZ
Date Posted: 17 April 2003 at 1:23pm
first off.. dont worry about the brackets.. they arent hurting anything...

second, that error means you are trying to compare two cols that are of different data types

how about that, the error told you exactly what was wrong :).. recheck your "topic_id"'s to make sure they all are of the same type


-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net