(Msg. 9) Posted: Wed Dec 17, 2008 3:20 pm
Post subject: Re: Joining Data from multiple tables using DRW [Login to view extended thread Info.] Archived from groups: microsoft>public>frontpage>programming (more info?)
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=::ID::
"Mike Mueller" <me RemoveThis @my.domain.com> wrote in message
news:OlglNc$XJHA.3808@TK2MSFTNGP05.phx.gbl...
> There would be a performance gain by turning this sql statement into a
> view
>
>
> "Stefan B Rusynko" <sbr_enjoy RemoveThis @hotmail.com> wrote in message
> news:ueWVb%231XJHA.5108@TK2MSFTNGP05.phx.gbl...
>> The OP is using link parameters from index.asp
>> So in the top of the team.asp page he needs
>> <%
>> TeamID=Request.QueryString("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.spiderwebwoman.com/thingumajig/tweaks.htm#passing >>
>> --
>>
>> _____________________________________________
>> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
>> "Warning - Using the F1 Key will not break anything!" (-;
>> _____________________________________________
>>
>>
>> "Jens Peter Karlsen" <jpkarlsen RemoveThis @mvps.org> wrote in message
>> news:366ek4dgflhpd3lt3s400dtt70qu4cpgrf@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="team1"
>> |
>> | Regards Jens Peter Karlsen.
>> |
>> | On Mon, 15 Dec 2008 12:46:49 -0500, "John P." <parkejo RemoveThis @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=teams.ID
>> | >
>> | >But I still get all the teams..
>> | >
>>
>>
>
>
(Msg. 10) Posted: Wed Dec 17, 2008 7:12 pm
Post subject: Re: Joining Data from multiple tables using DRW [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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=::ID::"
WHERE sponsors.teamid=::ID::"
"John P." <parkejo.RemoveThis@gmail.com> wrote in message
news:%23JsUoTIYJHA.5336@TK2MSFTNGP02.phx.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=::ID::
>
>
>
>
>
> "Mike Mueller" <me.RemoveThis@my.domain.com> wrote in message
> news:OlglNc$XJHA.3808@TK2MSFTNGP05.phx.gbl...
>> There would be a performance gain by turning this sql statement into a
>> view
>>
>>
>> "Stefan B Rusynko" <sbr_enjoy.RemoveThis@hotmail.com> wrote in message
>> news:ueWVb%231XJHA.5108@TK2MSFTNGP05.phx.gbl...
>>> The OP is using link parameters from index.asp
>>> So in the top of the team.asp page he needs
>>> <%
>>> TeamID=Request.QueryString("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.spiderwebwoman.com/thingumajig/tweaks.htm#passing >>>
>>> --
>>>
>>> _____________________________________________
>>> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
>>> "Warning - Using the F1 Key will not break anything!" (-;
>>> _____________________________________________
>>>
>>>
>>> "Jens Peter Karlsen" <jpkarlsen.RemoveThis@mvps.org> wrote in message
>>> news:366ek4dgflhpd3lt3s400dtt70qu4cpgrf@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="team1"
>>> |
>>> | Regards Jens Peter Karlsen.
>>> |
>>> | On Mon, 15 Dec 2008 12:46:49 -0500, "John P." <parkejo.RemoveThis@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=teams.ID
>>> | >
>>> | >But I still get all the teams..
>>> | >
>>>
>>>
>>
>>
>
>
All times are: Eastern Time (US & Canada) (change) Goto page Previous1, 2
Page 2 of 2
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum