Results 1 to 2 of 2

Thread: ASP and multiple query help...

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    34
    First question...is there a site similar to this one for ASP Q and A?

    Now...here's my ASP question....

    Here's my challenge. All fields are not defined here...

    Table "Customers"

    row=1 field=SalesPerson value=2
    row=1 field=CustomerEngineer value=6

    Table "People"

    row=1 field=id value=2
    row=1 field=name value=name1
    row=2 field=id value=6
    row=2 field=name value=name2

    My question is...since table "Customers" has a need to call two "name" fields from table "People"...how do I query the tables and have asp post the data to the page as follows:

    html page

    salesperon: name1
    customer engineer: name2

    Do you see the complication here??? It has boggled my mind...at first I run an inner join query...it works, but guess what...it gives me "name1" for both the salesperson and customer engineer.

    Here's the problem when I run the join query...

    the asp page calls.... request.write(rsResults.Fields("name")) ....

    see the problem??

    Should this be a simple task?? Will includes or global.asa ever come into play...help, please?!

    Thanks,
    Dave

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    We need to see the table field layouts (at least the ones involved in relationships) and the relationships between them so we can get the correct SQL join statement. After that, it would be just for your ASP page

    do until rs.eof = true
    response.write rs.fields("fieldname").value
    rs.movenext
    loop

Posting Permissions

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



Click Here to Expand Forum to Full Width