PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Query Strings using Web Matrix

Reply

Query Strings using Web Matrix

 
Thread Tools Rate Thread
Old 16-06-2006, 07:44 PM   #1
=?Utf-8?B?Z2xlbm4=?=
Guest
 
Posts: n/a
Default Query Strings using Web Matrix


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.

Any clues?

thanks,
glenn
  Reply With Quote
Old 16-06-2006, 09:00 PM   #2
=?Utf-8?B?Z2xlbm4=?=
Guest
 
Posts: n/a
Default RE: Query Strings using Web Matrix

Sorry folks. I answered my own question. I needed to create a function and
pass it a parameter. duh..

"glenn" wrote:

> 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.
>
> Any clues?
>
> thanks,
> glenn

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off