Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    124

    Unanswered: 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-

  2. #2
    Join Date
    Jan 2004
    Posts
    124
    Figured it out. Thanks.
    -Dman100-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •