473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Foreign key queries

I am currently running Access 2003 on Windows XP. I am doing a database of office files which require two foreign key fields: status and location. Each one is referred to by two other tables: Boxes and files. Files can be boxed or loose (on someone's desk or otherwise free).

I am currently working with the system viz the Box table. When I set up the two lookups, one of them ends up stored as a number (the status FK) but the other (location) gets stored as a text string (location description).

When I try to do a query on the status field (which is being stored as a number) and try to request the items with a value (criteria) of 2 (with or without quotes) it gives me the error message "type mismatch in expression"
Aug 15 '07 #1
1 1515
Rabbit
12,516 Expert Mod 8TB
Post the SQL string you're using.
Aug 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jean-Christian Imbeault | last post by:
Is it right for postgres to accept a foreign key constraint when the type of the field is not the same as that of the foreign key? For example: # Create table a (id int primary key); NOTICE: ...
2
by: StaZ | last post by:
Hello, This is my first post, i couldn't find an answer to my problem over the other posts. first - I have a Main table called , this table has a primary key that is an autonumber. second -...
2
by: JimJim | last post by:
Wondering if someone here could help me out, I've tried a number of ways to do this, and while I have managed to get it to work, Im SURE im not doing the optimal way, and it seems to be causing...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
7
by: Anony Mous | last post by:
Hi, I'm fairly new to this database, and have read much discussion on sub-queries. I've seen that they can be great for some queries, and downright slow for others. I have a table with two...
4
by: Josh Close | last post by:
How can a delete rows from a table that has foreign key constraints? Here is how I have it set up. I have 2 tables, tableA has fields and id's and tableB has fields that reference tableA's id's....
5
by: zeljko.prince | last post by:
Given the following table: CREATE table1 (a INTEGER PRIMARY KEY) TYPE=INNODB; It is possible to create a relation between table1 i table2 using the following syntax: CREATE table2 (a INTEGER...
2
by: gubbachchi | last post by:
Hi, How to use foreign key with join queries. I have used the query SELECT first_name,last_name,user_email from Info,Registry WHERE user_id='1'; where user_id = foreign key...
1
MGrowneyARSI
by: MGrowneyARSI | last post by:
Ok I'm a newbie when it comes to MySQL but I have done work in Oracle before and written allot of SQL code in my access DBs. I'm working on converting the tables from one of my Access DBs over to...
2
by: jarea | last post by:
I have read quite a bit about this error but I have yet to find the solution to my problem. I am trying to execute the following mysql statement: alter table line_items add...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.