Hi folks,
I have two tables in one database.
One table has an automatic numbering primary key named ID and is named rfi.
The other table has a field named rfinumber and is named discussion.
Both ID and rfinumber have a datatype of number.
Upon using the querybuilder with Web Matrix, I issue a select command to get all records from the discussion table that have a rfinumber field equal to the ID field in the rfi table.
Problem is that I am getting the entire discussion table when I use the following query:
"SELECT [discussion].* FROM [discussion], [rfi] WHERE ([discussion].[rfinumber] = [rfi].[ID])"
For example
DISCUSSION TABLE
rfinumber
1
1
1
2
RFI TABLE
rfi
1
2
Given the query, I should get a discussion table only listing the rfinumber = 1.
When I run the query from my database package it runs fine??
Any clues?
thanks,
glenn
gmeadows:
Problem is that I am getting the entire discussion table when I use the following query:
That's exactly what I would expect. You are returning a row from discussion matched with each row from rfi where the rfinumber from discussion is the same as the ID from rfi. Why would you expect it only to return those rows where rfinumber = 1? You need to use a parameter of some sort to make that happen.
No comments:
Post a Comment