If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > inner join query help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-04, 21:18
-Dman100- -Dman100- is offline
Registered User
 
Join Date: Jan 2004
Posts: 124
inner join query help

I have the following SQL statement:

SELECT *
FROM dbo.tblWeblog, dbo.tblUserComments
WHERE tblWeblog.blogID = MMColParam2
ORDER BY blogDate DESC

variable name = MMColParam2
variable default value = 0
variable Run-Time value = Request.QueryString("blogID")

I'm trying to return the records that have the same blogID in both tables. I created a one to many relationship between the two table using the primary key blogID in tblWeblog and a foreign key field "blogID" in tblUserComments. The above query returns all records in tblUserComments and isn't associated to a specific blogID number.

I'm not sure, is the querystring value in URL string a string value? The data type for the field blogID in both tables is an integer. Could that be the problem? Or, is the problem related to the query?

Thanks for any help!
-Dman100-
Reply With Quote
  #2 (permalink)  
Old 09-17-04, 02:20
-Dman100- -Dman100- is offline
Registered User
 
Join Date: Jan 2004
Posts: 124
Figured it out. Thanks.
-Dman100-
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On