What is Atom?
Joining Data from multiple tables using DRW
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > General Web-programming > Joining Data from multiple tables using DRW 18 December 2008 04:12:29

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

Joining Data from multiple tables using DRW

John P. 13 December 2008 00:36:45
 Is there any way to create a results page combining data from multiple
tables in the same database?

John P.


Add comment
Kathleen Anderson 13 December 2008 00:55:34 permanent link ]
 You should be able to do it the same way you do with one table. The only
thing that won't work is Lookup fields. To get a jump start, write your
query in Access and copy and paste the SQL into the DRW.

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwe­bwoman.com/xweb/
Expression Web Wiki: http://expression-w­eb-wiki.com/
FrontPage Resources: http://www.spiderwe­bwoman.com/resources­/
Please reply to the newsgroup for the benefit of others


"John P." <parkejo@gmail.com>­ wrote in message
news:ur2G3GKXJHA.53­28@TK2MSFTNGP05.phx.­gbl...
Is there any way to create a results page combining data from multiple
tables in the same database?
John P.


Add comment
John P. 15 December 2008 00:27:57 permanent link ]
 Thanks Kathleen, I managed to do that with your help..

My next step is that I have a page with multiple choices:

Team 1
Team 2 etc.

and when I select say Team 1 I go to a summary page which I want to show
only data associated with team 1, but using a custom SQL I keep getting all
Teams..

I have been very succesful doing this with a single table as the DRW helps
greatly, but need help to do it with joining tables using a custom sql code.

John P.




"Kathleen Anderson" <kanderson@remove.m­vps.org> wrote in message
news:eGVheRKXJHA.49­60@TK2MSFTNGP02.phx.­gbl...
You should be able to do it the same way you do with one table. The only
thing that won't work is Lookup fields. To get a jump start, write your
query in Access and copy and paste the SQL into the DRW.
--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwe­bwoman.com/xweb/
Expression Web Wiki: http://expression-w­eb-wiki.com/
Please reply to the newsgroup for the benefit of others
"John P." <parkejo@gmail.com>­ wrote in message
news:ur2G3GKXJHA.53­28@TK2MSFTNGP05.phx.­gbl...
Is there any way to create a results page combining data from multiple
tables in the same database?
John P.


Add comment
Kathleen Anderson 15 December 2008 01:06:47 permanent link ]
 Glad you made it this far.

You need to add a WHERE clause to your SQL:
http://www.w3school­s.com/sql/sql_where.­asp

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwe­bwoman.com/xweb/
Expression Web Wiki: http://expression-w­eb-wiki.com/
FrontPage Resources: http://www.spiderwe­bwoman.com/resources­/
Please reply to the newsgroup for the benefit of others


"John P." <parkejo@gmail.com>­ wrote in message
news:emFVPLjXJHA.22­80@TK2MSFTNGP06.phx.­gbl...
Thanks Kathleen, I managed to do that with your help..
My next step is that I have a page with multiple choices:
Team 1
Team 2 etc.
and when I select say Team 1 I go to a summary page which I want to show
only data associated with team 1, but using a custom SQL I keep getting
all Teams..
I have been very succesful doing this with a single table as the DRW helps
greatly, but need help to do it with joining tables using a custom sql
code.
John P.
"Kathleen Anderson" <kanderson@remove.m­vps.org> wrote in message
news:eGVheRKXJHA.49­60@TK2MSFTNGP02.phx.­gbl...
You should be able to do it the same way you do with one table. The only
thing that won't work is Lookup fields. To get a jump start, write your
query in Access and copy and paste the SQL into the DRW.
--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwe­bwoman.com/xweb/
Expression Web Wiki: http://expression-w­eb-wiki.com/
Please reply to the newsgroup for the benefit of others
"John P." <parkejo@gmail.com>­ wrote in message
news:ur2G3GKXJHA.53­28@TK2MSFTNGP05.phx.­gbl...
Is there any way to create a results page combining data from multiple
tables in the same database?
John P.


Add comment
John P. 15 December 2008 20:46:49 permanent link ]
 Thanks again Kathleen, I am sure I am getting close but still no luck.

The statement I have (which verifies okay) is

SELECT teams.ID, teams.*, sponsors.*
FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
WHERE sponsors.teamid=tea­ms.ID

But I still get all the teams..

I have shown the sample here: http://rightfast.co­m/test1/ and if you
select a team you can see the result.

Thanks
John P.



"Kathleen Anderson" <kanderson@remove.m­vps.org> wrote in message
news:OLtdEhjXJHA.50­64@TK2MSFTNGP02.phx.­gbl...
Glad you made it this far.
You need to add a WHERE clause to your SQL:
--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwe­bwoman.com/xweb/
Expression Web Wiki: http://expression-w­eb-wiki.com/
Please reply to the newsgroup for the benefit of others
"John P." <parkejo@gmail.com>­ wrote in message
news:emFVPLjXJHA.22­80@TK2MSFTNGP06.phx.­gbl...
Thanks Kathleen, I managed to do that with your help..
My next step is that I have a page with multiple choices:
Team 1
Team 2 etc.
and when I select say Team 1 I go to a summary page which I want to show
only data associated with team 1, but using a custom SQL I keep getting
all Teams..
I have been very succesful doing this with a single table as the DRW
helps greatly, but need help to do it with joining tables using a custom
sql code.
John P.
"Kathleen Anderson" <kanderson@remove.m­vps.org> wrote in message
news:eGVheRKXJHA.49­60@TK2MSFTNGP02.phx.­gbl...
You should be able to do it the same way you do with one table. The only
thing that won't work is Lookup fields. To get a jump start, write your
query in Access and copy and paste the SQL into the DRW.
--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwe­bwoman.com/xweb/
Expression Web Wiki: http://expression-w­eb-wiki.com/
Please reply to the newsgroup for the benefit of others
"John P." <parkejo@gmail.com>­ wrote in message
news:ur2G3GKXJHA.53­28@TK2MSFTNGP05.phx.­gbl...
Is there any way to create a results page combining data from multiple
tables in the same database?
John P.


Add comment
Jens Peter Karlsen 16 December 2008 06:05:16 permanent link ]
 Of course you get them all. Your WHERE clause would only exclude teams
that doesn't have a sponsor.
You should use the specifik ID of the team you want results from not
all IDs as you do below. Something like:
SELECT teams.ID, teams.*, sponsors.*
FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
WHERE sponsors.teamid="te­am1"

Regards Jens Peter Karlsen.

On Mon, 15 Dec 2008 12:46:49 -0500, "John P." <parkejo@gmail.com>­
wrote:

Thanks again Kathleen, I am sure I am getting close but still no luck.
The statement I have (which verifies okay) is
SELECT teams.ID, teams.*, sponsors.*
FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
WHERE sponsors.teamid=tea­ms.ID
But I still get all the teams..
Add comment
Stefan B Rusynko 16 December 2008 12:20:56 permanent link ]
 The OP is using link parameters from index.asp
So in the top of the team.asp page he needs
<%
TeamID=Request.Quer­yString("ID")
'add check to send them back if no team id in query string
IF Len(TeamID)=0 Then Response.Redirect "index.asp"
%>

Then the SQL would be
SQL="SELECT teams.ID, teams.*, sponsors.* FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid WHERE sponsors.teamid=" &
TeamID


See http://www.spiderwe­bwoman.com/thingumaj­ig/tweaks.htm#passin­g

--

___________________­____________________­______
SBR @ ENJOY (-:­ [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
___________________­____________________­______


"Jens Peter Karlsen" <jpkarlsen@mvps.org­> wrote in message news:366ek4dgflhpd3­lt3s400dtt70qu4cpgrf­@4ax.com...
| Of course you get them all. Your WHERE clause would only exclude teams
| that doesn't have a sponsor.
| You should use the specifik ID of the team you want results from not
| all IDs as you do below. Something like:
| SELECT teams.ID, teams.*, sponsors.*
| FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
| WHERE sponsors.teamid="te­am1"
|
| Regards Jens Peter Karlsen.
|
| On Mon, 15 Dec 2008 12:46:49 -0500, "John P." <parkejo@gmail.com>­
| wrote:
|
| >Thanks again Kathleen, I am sure I am getting close but still no luck.
| >
| >The statement I have (which verifies okay) is
| >
| >SELECT teams.ID, teams.*, sponsors.*
| >FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
| >WHERE sponsors.teamid=tea­ms.ID
| >
| >But I still get all the teams..
| >


Add comment
Mike Mueller 18 December 2008 04:12:29 permanent link ]
 What I would do is take MOST of your sql statement
"SELECT teams.ID, teams.*, sponsors.* FROM teams INNER JOIN sponsors ON
teams.ID = sponsors.teamid"
and create a View in sql (or query in Access) and I'll call it
vTeamsToSponsors.

Then; in your web page coding, I would use this SQL statement
"SELECT * FROM vTeamsToSponsors WHERE sponsors.teamid=::I­D::"





WHERE sponsors.teamid=::I­D::"

"John P." <parkejo@gmail.com>­ wrote in message
news:%23JsUoTIYJHA.­5336@TK2MSFTNGP02.ph­x.gbl...
Thanks everyone, I am really getting close now. I have it reurning only
for the applicable team but is shows a complete view for each sponsor I am
just trying to show 1 view with all the sponsors available.
But again I really appreciate your help as I have climed over a couple of
barriers.
Thanks
John P.
The statement I have in place is:
SELECT teams.ID, teams.*, sponsors.* FROM teams INNER JOIN sponsors ON
teams.ID = sponsors.teamid WHERE sponsors.teamid=::I­D::
"Mike Mueller" <me@my.domain.com> wrote in message
news:OlglNc$XJHA.38­08@TK2MSFTNGP05.phx.­gbl...
There would be a performance gain by turning this sql statement into a
view
"Stefan B Rusynko" <sbr_enjoy@hotmail.­com> wrote in message
news:ueWVb%231XJHA.­5108@TK2MSFTNGP05.ph­x.gbl...
The OP is using link parameters from index.asp
So in the top of the team.asp page he needs
<%
TeamID=Request.Quer­yString("ID")
'add check to send them back if no team id in query string
IF Len(TeamID)=0 Then Response.Redirect "index.asp"
%>
Then the SQL would be
SQL="SELECT teams.ID, teams.*, sponsors.* FROM teams INNER JOIN sponsors
ON teams.ID = sponsors.teamid WHERE sponsors.teamid=" &
TeamID
--
___________________­____________________­______
SBR @ ENJOY (-:­ [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
___________________­____________________­______
"Jens Peter Karlsen" <jpkarlsen@mvps.org­> wrote in message
news:366ek4dgflhpd3­lt3s400dtt70qu4cpgrf­@4ax.com...
| Of course you get them all. Your WHERE clause would only exclude teams
| that doesn't have a sponsor.
| You should use the specifik ID of the team you want results from not
| all IDs as you do below. Something like:
| SELECT teams.ID, teams.*, sponsors.*
| FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
| WHERE sponsors.teamid="te­am1"
|
| Regards Jens Peter Karlsen.
|
| On Mon, 15 Dec 2008 12:46:49 -0500, "John P." <parkejo@gmail.com>­
| wrote:
|
| >Thanks again Kathleen, I am sure I am getting close but still no
luck.
| >
| >The statement I have (which verifies okay) is
| >
| >SELECT teams.ID, teams.*, sponsors.*
| >FROM teams INNER JOIN sponsors ON teams.ID = sponsors.teamid
| >WHERE sponsors.teamid=tea­ms.ID
| >
| >But I still get all the teams..
| >


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > General Web-programming > Joining Data from multiple tables using DRW 18 December 2008 04:12:29

see also:
unable to edit user 4.3.1
Auto Log off
pass tests:
Do you know women?
Trix
see also:
Enjoy your DVD and Video with the new…
Zune HD vs. iPod Touch: which is better…
Android or Windows Mobile: which is…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .